Report parameters when using DoCmd.OutputTo

OK,
  Thank you one and all for answering my last question. I have another one. OK, I can set the report's parameters using the where clause part of the DoCmd.OpenReport. Great! But I also save that report as a text file using the following command
DoCmd.OutputTo acOutputReport, "rptSalesInvoiceEntryWineShip", acFormatTXT, strInvoicePath & Me.txtInvoiceNumber & ".txt", False
Unfortunately, there is no where clause part available!! OK, any ideas here. thanks!!
Ed Cohen
Edgar Cohen

The other way to do this, which avoids having to open the report in print preview, is to base the report on a query which references a control on a form (presumably the txtInvoiceNumber control in your case), as a parameter.
As it happens there is a demo file which does exactly this, using a simple invoicing database as the example, as InvoicePDF.zip, in my public databases folder at:
https://skydrive.live.com/?cid=44CC60D7FEA42912&id=44CC60D7FEA42912!169
You might have to copy and paste the text of the above (not copy the link location) into your browser; for some reason it sometimes doesn't seem to work as a hyperlink.
As its name suggests this creates a PDF file of the invoice, which is primarily what the demo is for, but it will work just the same if outputting to a text file.
Ken Sheridan, Stafford, England

Similar Messages

  • Report does not render image when using DoCmd.OutputTo to PDF

    Hello All.... and Happy new year !!!
    I have a form that has an embedded report and a series of cmd buttons to print the report or export it to file and saves it.
    In the report I have an Image object (a logo) that is in the header.
    When I print the report to a printer or a PDF printer the image is present.
    When I use DoCmd.OutputTo the report is properly exported to PDF and saved but the image is not present.
    I've tried playing with the ExportQuality, the "fit to page", etc... but nothing seems to get it working.
    here is the vba I use 
    'Open the report as hidden to filter the data
    DoCmd.OpenReport reportToExport, acViewPreview, , filterReportBy, acHidden
    'if we show the report
    If (booSeeFile) Then
    'export to pdf to save and autostart
    DoCmd.OutputTo acOutputReport, reportToExport, acFormatPDF, filepath, vbYes
    Else
    'export to pdf to save
    DoCmd.OutputTo acOutputReport, reportToExport, acFormatPDF, filepath
    End If
    Any help would be great !

    given that you've gone 12 hours with no reply; I generally don't have any problem with the logo going from the Report object to the PDF export.  When a report is opened on screen - right click - and one of the choices is 'Export To' and one of those
    choices is 'PDF or XPS' - - - just try that as a sanity check....
    there are 2 kinds of image controls - I can't remember off hand their formal name but one has the image embedded permanently inside the report object and so this one should go to the PDF.....the other type is a file link to the image for which the advantage
    is that image can be dynamically changed on the fly.  This second type probably will not appear in an export as the file link is probably broken....
    hope this helps a little......
     

  • Applying report filter when using OBIEE web services

    Hi
    Would like to know if it's possible apply report filter when using the web serivce ? Read from Oracle doc that there's this applyReportParams() method in ReportEditingService that could do the job. Can anyone confirm this ?
    Currently we've tried to access the report using the WebCatalogService, read the xml and retrieve the result using the XMLViewService successfully. However there's an additional requirement to pass in the report filter on the fly.
    Thanks in advance

    Hi Gerardnico,
    I have a question regarding the OBIEE Web Services,
    We are using C # for Automation code to test Obiee Analysis Web Services,while designing filter in C # to call report we are facing difficulty with Presentation Variable using Variable value. Where as it is working fine for Column value.
    Note: The choice list has 2 custom values.
    So please guide me in this regard.
    Regards,
    Pj

  • Create PDF using DoCmd.Outputto method in legal size page

    I am working in MS Access 2010. I am trying to convert a report to a PDF file.  I am using the following command "DoCmd.Outputto acOutputReport, Report Name, acFormatPDF, FileName".  The report I am using is formatted in legal page
    size.  When the PDF is created  using letter size pages and the buttom of each page is cut off.  I would like to find out why this is happening.
    Bob Gouveia

    Open the report in Design mode. Click Page Setup, go to the Page tab, and click the "Use Specific Printer" readio button. Click Printer. Select the Adobe PDF printer, then click Properties. Make sure Legal is the selected paper size. Click OK twice to get
    back to the page setup window. Make sure the paper Size field is Legal, and Source is Automatically Select.
    When I do this OutputTo --> PDF corretly uses the size (Legal) and orientation (Landscape) that I selected. Does this work for you?
    jmh

  • Problem with empty report parameters when passed to PL/SQL function

    Hi,
    We have come across what appears to be a bug in the JRC. When passing a report parameter to a PL/SQL function as a parameter, empty parameters are changed before being sent to the function. More specifically, an empty string "" ends up as the value "(')" in the PL/SQL function parameter. In our report we print the report parameters on the first page so we know that the parameters are OK before being passed to the database.
    The problem exists for version 12.2.203, 12.2.204 and 12.2.205 of the JRC.
    We have identified a workaround, but it is not exactly elegant: Before executing the report we modify all empty  parameters ("") to " " . In the PL/SQL function, we trim all parameters before using them.
    We call the function using a command object with a sql syntax like this example:
    select * from table (qa_batch_release.get_qa_br('{?p_report_id}','{?p_reg_set_number}','{?p_cr_number}','{?p_change_id_decode}','{?p_country_id}','{?p_mfg_item_no}','{?p_4_no}','{?p_5_no}','{?p_7_no}'))
    The PL/SQL function is a table returning function.
    Best regards, Thor

    Hi Kishore,
    using #COLUMN_VALUE# would probably not make much sense, because normally a report has multiple columns and not just the numeric column which you want to verify if it's negative. But APEX will fire the template condition for each column, because the report template is a column cell template.
    What you can do to make it more generic is to use for example
    #CHECK_AMOUNT#
    in the template and provide a not displayed column in your SQL statement which contains your value which is named CHECK_AMOUNT. For example:
    SELECT NAME
         , BALANCE
         , BALANCE AS CHECK_AMOUNT
    FROM XXX;Because this CHECK_AMOUNT column would be a generic name, you can use this template in all your reports as long as you provide this column.
    Thope that helps
    Patrick

  • Missing Parameters when using .PrintToPrinter or .ExportToDisk

    I am creating a viewer that will set login information and allow the users to view, print or export reports.  VB.NET 2010 WinForms Crystal Engine 13.0.9.1312.  All reports are external designed by various programmers.
    The preview mode of my viewer is now working quite well (with the help of Don and Ludek most recently).  Anything I want to see on screen works great in the regular Crystal viewer.
    The problem is when I want to export to pdf or print to a printer without viewing on screen in the regular Crystal viewer.
    If there are no parameters in the reports, both exporting to pdf and printing to any printer selected works.
    When there is one or more parameters, it crashes and points to the line
    crReport.ExportToDisk(ExportFormatType.PortableDocFormat, strFile)
    or
    crReport.PrintToPrinter(1, True, 0, 0)
    with the message Missing Parameter Values.
    Through some searching (and yes I have checked on this site and Google for "Missing Parameter Values") I have found one big issue is that parameter values have to be set after the .ReportSource is set.  So before I changed my code, I never saw the Crystal Parameter prompt screen.  Now I see it but still get the crash (though once I have had it go to printer honouring the Parameter in a report, but I can't always reproduce it and never when sending to pdf).
    The reports may be designed by end users who are using my program.  I will not know what reports they are or if they have even put in parameters.  I will not know if they are date, string, number, discrete, range, multiple, etc.
    The original login code referred to below can be found here.
             'original login code here down to subreport login
             'rest of subroutine is just a Catch and End Try
             crViewer.ReportSource = Nothing
             crViewer.ReportSource = crReport
             'check if to be sent direct to printer and send all pages
             If Not autoforms Is Nothing AndAlso autoforms.ToPrinter Then
                crReport.PrintOptions.PrinterName = autoforms.Printer
                crReport.PrintToPrinter(1, True, 0, 0)   '-> Error Triggers Here
             End If
             'setup viewer options
             Dim intExportFormatFlags As Integer
             intExportFormatFlags = ViewerExportFormats.PdfFormat Or
                                     ViewerExportFormats.ExcelFormat Or
                                     ViewerExportFormats.ExcelRecordFormat Or
                                     ViewerExportFormats.XLSXFormat Or
                                     ViewerExportFormats.CsvFormat
             crViewer.AllowedExportFormats = intExportFormatFlags
             crViewer.ShowLogo = False
             crViewer.ToolPanelView = ToolPanelViewType.GroupTree
             'check if to be sent direct to pdf and send all pages
             If Not autoforms Is Nothing AndAlso autoforms.ToPDF Then
                Dim strPDFFilename As String = autoforms.PDFPath & "\" & autoforms.ReportName & "_" & autoforms.ReportType & ".pdf"
                'strPDFFilename = Replace(strPDFFilename, " ", "_")
                SendExport(strPDFFilename, "PDF")
             End If
             'if not preview then close form
             If Not autoforms Is Nothing AndAlso Not autoforms.Preview Then
                Me.Close()
                Exit Sub
             End If
    Private Sub SendExport(ByVal strFile As String, ByVal strExportFormat As String)
          'pass current parameter values to the pdf
          Dim crParamFieldDefs As ParameterFieldDefinitions
          Dim crParamFieldDef As ParameterFieldDefinition
          Dim crParamValues As New ParameterValues
          Dim x As Integer = crViewer.ParameterFieldInfo.Count
          crParamFieldDefs = crReport.DataDefinition.ParameterFields
          'loop through each parameter and assign it the current values
          For Each crParamFieldDef In crParamFieldDefs
             crParamValues = crParamFieldDef.CurrentValues
             crParamFieldDef.ApplyCurrentValues(crParamValues)
          Next
          Select Case strExportFormat
             Case Is = "PDF"
                crReport.ExportToDisk(ExportFormatType.PortableDocFormat, strFile)  '--> Error Triggers Here
             Case Is = "xls"
                crReport.ExportToDisk(ExportFormatType.Excel, strFile)
             Case Is = "xlsx"
                crReport.ExportToDisk(ExportFormatType.ExcelWorkbook, strFile)
          End Select
    End Sub
    This code doesn't work on my system, but my logic is as follows (as flawed as it is).  Look through the parameters, find the current values and then assign them to the parameters again just before export.
    With the code above, I am getting the enter parameter values screen in the viewer.  Therefore, my assumption is that the report now has a current value(s) for the parameter(s).  The loop will not require the program to know how may parameters there are or what the values or value types are.
    There are a couple of problems with this.  When I step through it, there are no current values, because the prompt doesn't come up with stepping through the code with F8.  Second problem is that it is finding the internal parameters used for subreport linking ({?PM-xxxxx}).  Third problem is that a lot of code I have looked at does not appear like it is assigning the reportsource to a viewer at all just to export or print to printer.  So is it necessary to do as I have done here?
    I am sorry this is so long and I appreciate anyone who has stuck to it this long.  I am at my wits end trying to figure out how to make this work.  I think there is a timing issue here but do not know how to resolve it.  I just want the report to trigger the prompts if there are parameters, then send the report screen, to pdf or to printer depending on the user's settings for the report (it may be any or all three options).  If you need more info, let me know.
    TIA, rasinc

    Hi
    I'd like to look at this from the "how parameters" work point of view. Then let's see if we can drill in on some of the details.
    The parameter prompt screen is driven by the viewer. E,g.; the screen will only be spawned on invocation of the viewer. If the viewer is not invoked (e.g.; direct print / export) the parameter prompt screen will not be displayed. Now, in your second post you say:
    With the code above, I am getting the enter parameter values screen in the viewer.
    This does not sound correct based on the above. E.g.; if the correct parameters are passed to the engine, the viewer should never be popping up the parameter screen. So to me it looks like the code for the parameter is not actually working. It looks like it is as there is no error as such. But as you get prompted, the engine is essentially saying; "I don't understand those parameters so as smart as I am, I'll use the parameter prompt screen to get them from the user on a silver platter".
    Ok. Now to some troubleshooting. I'd pick a report where I know the parameter type and acceptable values ahead of time. Don't use date or date / time params to start with as these have other complication. Use the parameter code to set the value(s) - preferably one value (I like to keep things simple). If the parameter is passed to the report engine correctly, there will not be a parameter prompt and the report will simply come up in the viewer. Once this works, add in a code for printing / exporting and comment out the viewer code. The report should print / export without any issues (no parameter prompt, no error). Repeat the above with a multi-parameter report.
    Then it will come to those date and date/time parameters. NULL handling, etc., etc. E.g.; this will not be trivial. And you will somehow need to know the parameter type (string / int / date) before you try to pass it into the report. More help:
    Sample apps
    vbnet_win_paramengine.zip
    vbnet_win_paramviewer.zip
    vbnet_win_multirangeparam.zip
    vbnet_win_rangeparameters.zip
    vbnet_win_sub_daterange_param_engine.zip
    vbnet_win_sub_daterange_param_viewer.zip
    The above samples are here: Crystal Reports for .NET SDK Samples - Business Intelligence (BusinessObjects) - SCN Wiki
    Helpful KBAs
    1688710 - When printing a Crystal report with parameters using 'PrintToPrinter' method, report does not prompt for parameter values
    1214110 - How to pass a Date/Time parameter to a report at runtime using VB .NET
    1496220 - Suppress the default parameter prompt when the parameter value is not passed through the code
    1893554 - How to pass a NULL value to a Crystal Reports optional parameter field using Visual Studio .NET
    1425379 - How to avoid being prompted for a parameter when refreshing a report running in a VS .NET application
    1461315 - Error; "Missing Parameter Values" when running a parameterized report using Crystal Reports SDK for VS .NET
    1215426 - Err Msg: "Missing parameter value" when printing or exporting in VS .NET
    And finally this:
    Crystal Reports for Visual Studio 2005 Walkthroughs
    (The above doc is good for all versions of CR and VS. It has some amazingly great "stuff" in it re. parameters, etc., and more.)
    - Ludek
    Senior Support Engineer AGS Product Support, Global Support Center Canada
    Follow us on Twitter

  • Report hangs when using Remote Desktop

    I am having trouble with Crystal Reports 11. I was wondering if there is a known issue when using it in conjuction with Remote Desktop.
    Here is the scenario.
    I am using Remote Desktop to connect to a server.
    I am running a report using Crystal Reports 11.
    The records have already been retrieved (approx. 800,000 records) and is printing - slowly.
    It takes around 75 minutes for the report to print 12 pages.
    If the Remote Desktop connection is closed, then re-established, the Crystal Reports pops up a message box stating "Not Supported". The pages of data the were previously printed are now blank. (For example: if it was on page 1 of 9+ it will go back to 1 of 1+ and the page will be blank.)
    If I use a VPN to connect to the network, then use the Remote Desktop Connection to connect to the server, the connection will periodically disconnect and the re-establish. This does not occur when not using Crystal Reports.
    Is there a problem with using Crystal Reports with Remote Desktop? Is there a better way to run my reports remotely?
    Thanks for any input.
    Ryan

    You may be better off posting this in the Crystal Reports Design forum as that team supports issues regarding working with the CR designer:
    SAP Crystal Reports
    Ludek

  • How to Suppress Report Total When Using Sum on Columns & Break Formatting

    I need to know how to NOT show the report total line when using the sum functionality with a break in a report.
    I am summing two columns, a debit amount and credit amount. I am breaking on the first column which is the level of a hierarchical query. I want to see something like this:
    Parent Record xxxxxxxxxxxxxx
    Parent Sum $$ $$
    Child Record xxxxxxxxxxxxxx
    Child Record xxxxxxxxxxxxxx
    Child Sum $$ $$
    However, when I run the report, I also get a report total line under the child sum which is really meaningless for this report.
    I have also tried creating this report as an interactive report. When applying the sum on the two columns, I do get the sum totals on the break only - no report total - however, it is reversing the order of the hierarchical query results putting the child records first and the parent records second.
    Thanks in advance for your help.

    Hi, and welcome!
    I don't think that there's an easy way to "switch off" the Total line on a report. The nearest I could suggest would be to either hide the entire row or colour the text so that it's the same as the background - either way, the total is calculated but the user won't see it.
    If you put something like the following into your report region's Region Footer:
    <script type="text/javascript">
    var outertable = document.getElementById("#REGION_ID#");
    var innertable = outertable.getElementsByTagName("TABLE")[1];
    var rs = innertable.rows;
    var lastrow = rs[rs.length-1];
    if (lastrow.cells[0].innerHTML == '<b>TOTAL</b>')
    rs[rs.length - 1].style.display = "none";
    </script>Then, on your report's Report Attributes page, scroll down to the Break Formatting section and put TOTAL into the "Display this text when printing report sums" setting. Also, in the "Layout and Pagination" section, set "Enable Partial Page Refresh" to No.
    The above code is based on the report and region templates that I'm using here: [http://apex.oracle.com/pls/otn/f?p=267:147] (Theme 18, "Report Region" region template and "Standard" report template). Your report may use different templates, so the first two lines on the code may have to change. #REGION_ID# would be replaced with the region's ID value (which would be "R" followed by a long number). As long as you can identify the HTML tag that uses this ID value, you can then get to the actual table that contains the data as it would be a TABLE within that tag - the [1] above is the second table within the region. In some instances, you may have to use "region_#REGION_ID#" as the starting point.
    Andy

  • "Server Busy" error in Crystal Reports XI when using date picker

    Hi,
    I have come across an issue whereby I get a error pop up when using the date picker to select a date parameter as I run a report from within Crystal Report XI on a particular PC. While I am able to type in the date using the yyyy-mm-dd format, selecting the date picker displays an error message titled "Server Error" stating that the program is not responding and giving options "Switch To" and "Retry". Selecting either button displays the same error message and need to kill the application from the Task Manager to restart.
    I have run the same report from other PCs (including using the date picker to pick a date parameter) without the error popping up. All of the PCs have the same version of the application.
    Has anyone come across this and how were you able to resolve it?

    yes test is a formula that i used to calculate a difference
    that should work, but i would put () around the
    (if(remainder(({ztrptActVol.CPT}*{tlkpBblMileage.CPT}),1)>0 and
    remainder(({ztrptActVol.CPT}*{tlkpBblMileage.CPT}),1)<1) then
    truncate(({ztrptActVol.CPT}*{tlkpBblMileage.CPT}))+1
    else ({ztrptActVol.CPT}*{tlkpBblMileage.CPT})
    rounding in crystal is a pain in the &&

  • Custom Report Erroring when using All as parameter

    Hi All,
    I am facing a problem in running custom report.
    => DB Server Info
    RDBMS : 11.2.0.2.0
    Oracle Applications : 12.1.3
    I am getting following error.
    REP-1401: 'afterpform': Fatal PL/SQL error occurred.
    ORA-06502: PL/SQL: numeric or value error
    custom report two parameters one is date parameter and name parameter
    date parameter is using as fnd_date.canonical_to_date(:P_EFFECTIVE_DATE) in queries.
    if I give name parameter for individual, then it works fine.
    if I give name parameter as "All", then its erroring. I tried it in my best way, but its not working.
    variable data length increased though its not working, can any one help me on this please....
    Here is the Afterpform code
    function AfterPForm return boolean is
    lName VARCHAR2(5000); -- its changed from lName varchar2(50);
    begin
    IF :P_NAME <> 'All' THEN
    lName:= 'AND name =:P_NAME';
    ELSE
    lName:='AND name in                                                             (select name from <******>
              order by name
    END IF;     
    :P_Where_Clause := lName;
    return (TRUE);
    end;
    Thanks for all your help so far.
    Ram.
    Edited by: user8822881 on Feb 9, 2012 10:43 AM

    excuse i understood that you use All as parameter name
    ORA 6502 is when you assign a char to a number or when assign a value which length is greater than the variable length
    what's the dimension of p_where_clause for example?
    you can trace with srw.message
    --- <Code>
    function AfterPForm return boolean is
    lName VARCHAR2(5000); -- its changed from lName varchar2(50);
    begin
    srw.message(1,'step 1');
    IF :P_NAME = 'All' THEN
    srw.message(2,'step 2');
    lName:='AND name in (select name from <table>
    order by name
    srw.message(3,'step 3');
    ELSE
    srw.message(4,'step 4');
    lName:= 'AND name =:P_NAME';
    srw.message(5,'step 5');
    END IF;
    srw.message(6,'step 6');
    :P_Where_Clause := lName;
    srw.message(7,'step 7');
    return (TRUE);
    end;
    ---</Code>
    i think your query is not good
    for example
    lName:= 'AND name =:P_NAME';
    when instance the query the query search this condition but no use the value of p_name parameter
    write
    lName:= 'AND name = '||''''||:P_NAME||''''; then :p_name take the value

  • Error-No value given for one or more required parameters when using oleDBDa

    Hello,
    I have this sql statement and it works well, the Crystal Report gives good result when I put concrete values like:
    string comstring = "SELECT NOVI.GBR as gbrnov, NOVI.AB as abnov, NALOG1.DATA as datanov, Min(NALOG1.POCKM) AS MinOfPOCKM, Max(NALOG1.KRAJKM) AS MaxOfKRAJKM, (Max(NALOG1.KRAJKM)-Min(NALOG1.POCKM)) AS RAZLIKA, Count(IIf(([MAGACIN.SIFRA]='0991000'),[MAGACIN.KOL],Null)) AS Gorivo, Avg(IIf(([MAGACIN.SIFRA]='0991000'),[MAGACIN.KOL],Null)/100) AS potrosgor100km, Sum(IIf(([MAGACIN.SIFRA]='0993050' Or [MAGACIN.SIFRA]='0993051'),[MAGACIN.KOL],Null)) AS Motmaslo, Sum(IIf(([MAGACIN.SIFRA]='0992201'),[MAGACIN.KOL],Null)) AS Addblue, ([Addblue]/[Gorivo])100 AS Addbluegor, Sum(IIf(([MAGACIN.SIFRA]='0999001'),[MAGACIN.KOL],Null)) AS Antifriz, NOVI.DATAP, NOVI.DATAS, IIf(([NOVI].[KM]<=([NOVI].[KMS1][NOVI].[KMS2])),'ZA SERVIS',(IIf(([NOVI].[KM]<=([NOVI].[KMP1][NOVI].[KMP2])),'PROVERKA',''))) AS Zabeleska FROM (NALOG1 INNER JOIN NOVI ON NALOG1.GBRV = NOVI.GBR) INNER JOIN MAGACIN ON NOVI.GBR = MAGACIN.GBR where (((NOVI.GBR)>='1001' And (NOVI.GBR)<='1080') AND ( ((NOVI.AB)='AK') OR ((NOVI.AB)='AK') ) AND ((NALOG1.DATA)<=#10/31/2011# and (NALOG1.DATA)>=#10/31/2011#) ) GROUP BY NOVI.GBR, NOVI.AB, NALOG1.DATA, ([Addblue]/[Gorivo])100, NOVI.DATAP, NOVI.DATAS, IIf(([NOVI].[KM]<=([NOVI].[KMS1][NOVI].[KMS2])),'ZA SERVIS',(IIf(([NOVI].[KM]<=([NOVI].[KMP1][NOVI].[KMP2])),'PROVERKA','')))";          
    but when I use code like this :
    string comstring = "SELECT NOVI.GBR as gbrnov, NOVI.AB as abnov, NALOG1.DATA as datanov, Min(NALOG1.POCKM) AS MinOfPOCKM, Max(NALOG1.KRAJKM) AS MaxOfKRAJKM, (Max(NALOG1.KRAJKM)-Min(NALOG1.POCKM)) AS RAZLIKA, Count(IIf(([MAGACIN.SIFRA]='0991000'),[MAGACIN.KOL],Null)) AS Gorivo, Avg(IIf(([MAGACIN.SIFRA]='0991000'),[MAGACIN.KOL],Null)/100) AS potrosgor100km, Sum(IIf(([MAGACIN.SIFRA]='0993050' Or [MAGACIN.SIFRA]='0993051'),[MAGACIN.KOL],Null)) AS Motmaslo, Sum(IIf(([MAGACIN.SIFRA]='0992201'),[MAGACIN.KOL],Null)) AS Addblue, ([Addblue]/[Gorivo])100 AS Addbluegor, Sum(IIf(([MAGACIN.SIFRA]='0999001'),[MAGACIN.KOL],Null)) AS Antifriz, NOVI.DATAP, NOVI.DATAS, IIf(([NOVI].[KM]<=([NOVI].[KMS1][NOVI].[KMS2])),'ZA SERVIS',(IIf(([NOVI].[KM]<=([NOVI].[KMP1][NOVI].[KMP2])),'PROVERKA',''))) AS Zabeleska FROM (NALOG1 INNER JOIN NOVI ON NALOG1.GBRV = NOVI.GBR) INNER JOIN MAGACIN ON NOVI.GBR = MAGACIN.GBR where (((NOVI.GBR)>=? And (NOVI.GBR)<=?) AND ( ((NOVI.AB)=?) OR ((NOVI.AB)=?) ) AND ((NALOG1.DATA)<=? and (NALOG1.DATA)>=?) ) GROUP BY NOVI.GBR, NOVI.AB, NALOG1.DATA, ([Addblue]/[Gorivo])100, NOVI.DATAP, NOVI.DATAS, IIf(([NOVI].[KM]<=([NOVI].[KMS1][NOVI].[KMS2])),'ZA SERVIS',(IIf(([NOVI].[KM]<=([NOVI].[KMP1][NOVI].[KMP2])),'PROVERKA','')))";
    Edited by: Don Williams on Nov 23, 2011 7:22 AM

    and the code after that:
    command.CommandText = comstring;
                if (radioButton4.Checked == true)
                    if (textBox1.Text == "")
                        button1.Enabled = false;
                        MessageBox.Show("Внесете гаражен број", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        textBox1.Focus();
                        command.Parameters.AddWithValue("@gbr1", textBox1.Text);
                        command.Parameters.AddWithValue("@gbr2", textBox1.Text);               
                else if (radioButton5.Checked == true)
                    command.Parameters.AddWithValue("@gbr1", "1001");
                    command.Parameters.AddWithValue("@gbr2", "1080");
                    button1.Enabled = true;
                    textBox1.Text = "";
                else if (radioButton6.Checked == true)
                    command.Parameters.AddWithValue("@gbr1", "1081");
                    command.Parameters.AddWithValue("@gbr2", "1149");
                    button1.Enabled = true;
                    textBox1.Text = "";
                else if (radioButton7.Checked == true)
                    command.Parameters.AddWithValue("@gbr1", "1001");
                    command.Parameters.AddWithValue("@gbr2", "1149");
                    button1.Enabled = true;
                    textBox1.Text = "";
                else
                    MessageBox.Show("Немате избрано гаражен број или тип на автобус.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    button1.Enabled = false;
                if (checkBox1.Checked == true && checkBox2.Checked==true)
                    command.Parameters.AddWithValue("@ab1", "AK");
                    command.Parameters.AddWithValue("@ab2", "GP");
                    button1.Enabled = true;
                else if ((checkBox1.Checked == true) && (checkBox2.Checked == false))
                    command.Parameters.AddWithValue("@ab1", "AK");
                    command.Parameters.AddWithValue("@ab2", "AK");
                    button1.Enabled = true;
                else if (checkBox2.Checked == true )
                    command.Parameters.AddWithValue("@ab1", "GP");
                    command.Parameters.AddWithValue("@ab2", "GP");
                    button1.Enabled = true;
                else
                    MessageBox.Show("Немате избрано автобаза.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    command.Parameters.AddWithValue("@ab1", "AK");
                    command.Parameters.AddWithValue("@ab2", "GP");
                    button1.Enabled = false;
                command.Parameters.AddWithValue("@data1", dateTimePicker1.Value.Date);
                command.Parameters.AddWithValue("@data2", dateTimePicker2.Value.Date);
                 DataSet2 dataSet2=new DataSet2();    
                 OleDbDataAdapter oleDBDataAdapter1 = new OleDbDataAdapter();
                oleDBDataAdapter1.SelectCommand=command;
                    dataSet2.Clear();
                    oleDBDataAdapter1.Fill(dataSet2,"Tabela");
                    if (dataSet2.Tabela.Count == 0)
                        MessageBox.Show("Nema podatoci za toj period");
                    ReportDocument cryRpt = new ReportDocument();
                    cryRpt.Load(@"C:\Potrosuvacka-Pregledi\Potrosuvacka-Pregledi\CrystalReport6.rpt");
                cryRpt.PrintOptions.PaperOrientation = CrystalDecisions.Shared.PaperOrientation.Landscape;
                    cryRpt.SetDataSource(dataSet2);
                    crystalReportViewer1.DisplayToolbar=true;
                crystalReportViewer1.ReportSource = cryRpt;                      
                crystalReportViewer1.Refresh();
                    conn.Close();
    I get an error:
    "No value given for one or more required parameters."
    Could anybody help me please?
    Thank you in advance.
    Edited by: nelpet06 on Nov 23, 2011 9:30 AM

  • Problem with SSAS cube reporting action when using pivot filter with cubevalue function

    Hi everyone,
    I have a quite specific problem when I combine cube actions (Reporting Action SSRS) with Excel's cubevalue() function.
    The problem is when I use a pivot filter as a parameter for the cubevalue() function. The action item does not show up in the context menue.
    The cube action works fine when I do it from a "normal" pivot or if I use the cubevalue() function without the reference to a pivot filter (all the parameters in the function are "hard-coded").
    I use SSAS 2012 and Excel 2010.
    Thanks for yor help.
    Gerhard

    Hi everyone,
    I actually figured out a way to solve this problem. I had to use a detour to solve this bug in Excel (at least I think it's a bug).
    What I needed to do: I had to make Excel belive that the filter is actuall hard-coded and does not come from a pivot filter. This was only possible by adding a new calculated measure to the cube that gives back the MEMBER_Unique_Name to the current member
    passed. This "value" can then be used to go back to the cube and select the cubemember function. Here is a small example.
    This is the cube member:
    CREATE MEMBER CURRENTCUBE.[Measures].[RegCompBranNameKey] AS
    [Company Branch].[Reg - Comp - Bran Name].CurrentMember.Properties("MEMBER_UNIQUE_NAME", TYPED),
    VISIBLE = 0 ;
    And this is then done in a hidden Excel cell:
    =CUBEMEMBER("Metrics";
     IF(RIGHT(CUBEVALUE("Metrics";<PivotFilter>;"[Measures].[RegCompBranNameKey]");5)="[ALL]";"[ALL]";
      RIGHT(CUBEVALUE("Metrics";<PivotFilter>;"[Measures].[RegCompBranNameKey]");LEN(CUBEVALUE("GlobalMetrics";<PivotFilter>;"[Measures].[RegCompBranNameKey]"))-57)
    I had to use the UniqueName property because I have a combined filter. That's also the reason for this truncation and also useing the last part of it. If you just have a straight key you more easily use it.

  • Hardcoded BAM server parameters when using BAM sensors

    The problem we're having is that when a BPEL process has BAM sensors, the BAM server configuration parameters are hardcoded in bpel.xml and sensorAction.xml.
    This causes problems when the process is being deployed to a different instance than the development instance.
    I solved the problem for the bpel.xml file with the <customize> ant task, but haven't found a solution yet for sensorAction.xml.
    Any suggestions?
    Thanks,
    Arnold van Koppen

    See..when the BAM Server is down the corresponding data objects wont be available to you..During the design time wat u do is create a variable which contains the elements dat u wanna monitor in the BAM...IN BAM u create data objects ..then u map the schema from the BPEL to the BAM Data Objects ...U need a BAM Server connection which pulls up the metadata from the server ..If the BAM Server is down u wont get the BAM DOs...to keep a back up u can use DB as the sensor action so that the data from the sensor action is written to the DB..Using a DB Adapter i think the data from the Reports schema can be written to the OracleBAM schema ...so that even if the BAM Server is down the data is written to the OracleBAM schema

  • How to get a report "closed" when using the ReportViewerBean

    I read the article /people/ted.ueda/blog/2008/12/20/crystal-reports-for-eclipse--ensuring-report-cleanup from Ted Ueda regarding cleaning up reports for the RAS server.  However, I'm trying to figure out how to get this accomplished for a thick client accessing a local rpt file and then displaying that file using the ReportViewerBean.  I can't seem to get the report closed. I tried the dispose() techniqe from the article, but with no success.
    My basic process is:
    1) Press button on main frame to open and set up report
    2) Pass open report (via ReportClientDocument) object to the viewer frame class (which views report in separate window using ReportViewerBean)
    3) Close viewer window when done, destroy ReportVieweBean and close ReportClientDocument
    4) Press button again on main frame later to view report
    If I set up the report but skip the step of sending the report to the viewer frame, ReportClientDocument.isOpen() will go from true to false after I execute just  the ReportDocumentClient.close() command.  However, if open the viewer frame, I cannot get the report closed.
    In the window closing event for my viewer window I have:
    public void quit() {
                try {
                    CrystalReportViewer crv1 = new CrystalReportViewer();
                    crv1.setReportSource(reportClientDoc.getReportSource());
                    reportViewer.destroy();  //this is a ReportViewerBean
                    reportClientDoc.close();  //this is a ReportClientDoc
                    crv1.dispose();
                    //the following is always true
                    System.out.println("ReportClientDoc.isOpen: " + reportClientDoc.isOpen());
                    this.dispose();
                catch(ReportSDKException ex) {
                    ex.printStackTrace();
                catch(ReportSDKExceptionBase ex) {
                    ex.printStackTrace();
    I'm using the latest Java CR4E 12.2.205.825 downloaded from the CR4E website.  Any ideas?
    Edited by: Joseph Huber on Mar 16, 2010 8:13 PM

    The webservices you are trying to use are not the ones used for enterprise, they are used for non-enterprise applications accessing reports that are stored in a specific location on the web server.
    Here are samples that use our Enterprise SDK:
    [https://boc.sdn.sap.com/samples/84/1193|https://boc.sdn.sap.com/samples/84/1193]
    Here are samples that use our Enterprise Web Service SDK:
    [https://boc.sdn.sap.com/samples/84/1197|https://boc.sdn.sap.com/samples/84/1197]
    You can also look at the SDK documentation available here:
    [http://devlibrary.businessobjects.com/BusinessObjectsXIR2SP2/en/devsuite.htm|http://devlibrary.businessobjects.com/BusinessObjectsXIR2SP2/en/devsuite.htm]

  • Handling parameters when using BI Server as a Data Source

    Hi,
    Following an upgrade of our BI Publisher 10g content to 11g I've come across a syntax issue with 11g when it comes to the handling of parameters in BI Server Data Sets.
    Under 10g, the documentation stated the following:
    +"If your data source is the Oracle BI Server, use the following macro to handle the null:+
    +{$ if ${sYear}='*'$}+
    +{$elsif ${sYear}='2000' $}+
    +where Year = :sYear+
    +{$else $}+
    +where Year = :sYear+
    +{$endif$} "+
    http://docs.oracle.com/cd/E10415_01/doc/bi.1013/e12187/T518230T518233.htm
    Under 11g it does not seem to allow the use of macros defined in Data Sets and raises the following error when saving the query:
    +"java.io.IOException: prepare query failed[nQSError: 43113] Message returned from OBIS. [nQSError: 27002] Near <$>: Syntax error [nQSError: 26012] ."+
    If macros are no longer supported, what is the best approach to handle null value parameters (caused by all choices / nothing being selected)
    as they need to be defined in the Data Set WHERE CLAUSE?
    I've tried a rather clunky CASE WHEN statement which handles string parameters fine, but dates are another thing as null values are returned as 'null' text which causes TYPE mismatch errors.
    Hopefully there is an elegant way to handle this in 11g (the 10g macros were very straight forward when dealing with BI Server)
    Many Thanks

    If what you are saying is true then I would highly recommend open a ticket with Oracle Support.
    They should provide and alternative for handling NULLS in 11g.
    regards
    Jorge

Maybe you are looking for

  • Copy control for sale office in delivery

    Hi, In our delivery note the field sale office is blank... we need that this field will be filled by copy control or user exit from document sale (order sale)... always the deliveries are for the same sales office. Any clues for achiving this? Best R

  • ABAP - FSCM

    Hi! How can I know which transaction or maintenance view add/modify/update records in table UDM_P2P_ATTR because I'm having problems with this table and I can't find that. In fact, table FDM_P2P_ATTR is being updated when I execute t-code: - FDM01 -

  • TA48312 my mac is osX version 10.5.8, how do i upgrade to osX lion

    my mac is osX version 10.5.8, how do i upgrade to osX lion

  • Install Sun Java Web System on Fedora / Registering in Netbeans

    Hi, I am trying to install Sun Java System Webserver onto Fedora 64 bit - I am not bothered about running a server locally, I have a development server for testing before deployment - however, I need to get a working install to let Netbeans recognise

  • How to display repeating fields on PDF template?

    I'm having trouble printing repeating fields on a PDF. I followed the BI user guide but the report generates only one row. The sample XML file has 6 employees. I want to print a row for each employee using PDF as my template instead of RTF document.