my report run but does not display anything in oracle - forms

I have designed report in 10g. When I call report through forms 10g than report executed but do not display anything. Kindly help me what I have to do to resolve this issue. I use .rep report and desformat is PDF. One thing more when in this desformat my report started downloading instead of giving a preview in internet explorer and downloaded pdf is empty (contain nothing).

Report displays the result of a query. So the most obvious question is: does the query, when you run it outside of the Forms/Reports application, work correctly and returns the result?
If it accepts certain parameters, verify that they are correctly passed. Mind the datatype, especially if DATE is involved as people usually have problems with different format masks, NLS settings and stuff.
Also, check whether those parameters are obligatory or not. If not, report's query should contain something like
where (some_value = :parameter_value or :parameter_value is null)
Furthermore, make sure that all those parameters are passed to the report. You can display their values in the report, just to see what's going on. Open Reports Paper Layout Editor, go to the margin and - using the ampersand notation - display those values, such as
Parameter one = &parameter_one
Parameter two = &parameter_two

Related

Crystal Report: Parameter damages the whole report

While using Crystal Reports I have encountered a strange bug, that repeats itself already with a number of my reports.
I still didn't fully get how I replicate it, but usually it goes as follows:
I add a parameter of any type to an existing report document, however it doesn't appear in a parameter prompt at all.
After I change parameter order in the Parameter Fields Section, my Parameter disappears and instead I see a duplicate of another parameter in a parameter list, and in the "Set Parameter Order"-Window I see this duplicated parameter as [ParameterName, ParameterName]. If I save the document in this moment and try to reopen it, CR crushes.
If I try to load this document in Vstudio with CREngine, the code exits with the message "Access violation".
Here is a pic of what is happening:
The reason you are not being prompted for the new "test" parameter is that it is not used by the report for anything.
The rest of the behavior is indeed strange. Consider removing the '#' character from the name of the first parameter to see if that fixes it.
If some of those parameters are from a stored procedure, perhaps your report is simply out of sync with the data source. Do Database, Verify Database...

Error in Opening Report from Form

I have a Form which will help me to filter out the records I want for my Report. The button will open the Report On Click.
This is the code in the button:
Private Sub Open_OEE_Click()
DoCmd.OpenReport "OEE_Report", acViewReport, , , acWindowNormal
End Sub
I keep getting the error:
I also have placed the query in my report under the Record Source as:
SELECT * FROM 3_OEE WHERE ((([3_OEE].RecordID)=Forms![3_OEE_Report]!cboRecordID) And (([3_OEE].Date_Recorded)=DateValue(Forms![3_OEE_Report]!Date_Recorded)) And (([3_OEE].MC_No)=Forms![3_OEE_Report]!cboMCNo) And (([3_OEE].Product)=Forms![3_OEE_Report]!cboProduct));
I want to search based on one criteria (text box or combo box) and not all four at once.
Am I missing out something?
MS-Access does tend to go a bit overboard with the brackets. Make the report's Record Source a bit easier to read by trimming out the unnecessary ones. You also need to get your date criterion in the right format - Access always uses US formatting in SQL queries and needs # signs around the date:
SELECT * FROM 3_OEE
WHERE [3_OEE].RecordID = Forms![3_OEE_Report]!cboRecordID
And [3_OEE].Date_Recorded = Format(Forms![3_OEE_Report]!Date_Recorded, "\#mm/dd/yyyy\#")
And [3_OEE].MC_No = Forms![3_OEE_Report]!cboMCNo
And [3_OEE].Product = Forms![3_OEE_Report]!cboProduct;
I would also suggest creating a named query for this and setting the report's Record Source to the named query. You can then test the query in isolation without having to run the report (but make sure the Form is open and the relevant controls are populated).
I asked for help from another source.
Answer to Question

SAP Central Management Console Parameters not aligned

I have been designing Crystal Reports, and publishing them to the SAP Central Management Console, for the past couple of years; but I have never come across this really strange issue before!
The report in question has 7 Parameters:
1 is a static String Parameter,
1 is a static Date Range Parameter
3 are static Number Parameters
1 is a static String Parameter with a pre-defined list of values
1 is a multi-level dynamic String Parameter
All of these parameters work fine when running reports from the Designer application itself, but as soon as it's published to the Central Management Console it all messes up:
If you choose the first Parameter, you get the first parameter input screen.
If you choose the second Parameter, you get the first parameter input screen.
If you choose the third Parameter, you get the second parameter input screen.
If you choose the fourth Parameter, you get the third parameter input screen.
etc
This means that there is no way of selecting the 7th Parameter as it shows you the 6th parameter input screen.
This behavior started when I added two of the static Number Parameters. Before this everything worked fine, and I cannot find online documentation/help which would allude to a Parameter limit in CMC.
Crystal Reports Designer Version: Crystal Reports 2008, Version 12.3.0.601
Central Management Console Version: SAP BusinessObjects Enterprise XI, Product 12.1.0
Thanks in advance for any help!
After investigating I realised that the problem was Central Management Console does not interact well with multi-level parameters.
I changed the multi-level parameter to two separate parameters, and everything is working.

SAP Subreport will print to PDF but not to viewer or printer

I have two different SAP Crystal Reports, one has sub reports and the other doesn't. For whatever reason the simple CR prints to the printer, to PDF and to the viewer just fine. The CR with subreports only prints to PDF for whatever reason. This is leading me to believe there's nothing inherently wrong with the report itself otherwise it wouldn't work when I save to PDF.
A snippet of my code is below (in VB):
Select Case PrintMedia
Case PrintType.Printer
crOrderPrintout.PrintToPrinter(1, False, 0, 0)
Case PrintType.Viewer
Dim frmReportViewer As New frmReportViewer
frmReportViewer.CrystalReportViewer1.ReportSource = crOrderPrintout
frmReportViewer.ShowDialog()
Case PrintType.File
crOrderPrintout.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, String.Format("C:\Documents and Settings\{0}\Desktop\{1}.pdf", mdlSharedVars.StripDomainFromFullUsername(WindowsIdentity.GetCurrent.Name), ReceiptID))
Case Else
crOrderPrintout.PrintToPrinter(1, False, 0, 0)
End Select
For clarification the PrintMedia is a variable whose type is a custom enum of mine, PrintType.
When I try to show the report with the subreport in the viewer or print to printer I get a "Index was out of range. Must be non-negative and less than the size of the collection.
Parameter: index." error. Yet the simple, non-subreport CR works just fine regardless of the PrintMedia.
Don't suppose anyone has any ideas??
After fighting with this for longer than I care to imagine, it turns out there was a problem with one of the fields in the crystal report display string. Basically I started the report from scratch, adding in piece by piece trying to isolate the error.
Can you try the report in an off the shelf Crystal viewer or Crystal Reports itself? Does it work?
Maybe try setting the printer options in page setup to "No Printer (Optimize for screen display)"

Crystal Reports - Default Parameters

In Crystal reports, you can define default values for the report parameters.
For example, I might have a date range and set a default start of 12/01/2008 and a default end of 12/31/2008.
Is it possible to modify these defaults at runtime? For example:
1 - Default to the first and last days of the current month?
2 - Default to the first and last days of a proprietary company fiscal calendar? (i.e., look it up in a database)
3 - First & Last days of the current year?
You get the point. Is this possible? I'd even be open to a solution that involved running an external application to reach into the reports and modify them, if anyone knows how to do that.
Edit:
To answer the question posed by Philippe Grondier, most of these reports are run from inside an application. I was hoping for something simpler than manipulating the crystal object at runtime; I have my hands full right now with figuring out other parts of that API. I might take a look in the future, though.
Are you planning to run your crystal report from the crystal reports interface or as an add-in embedded in another program (you can for example use the Crystal Reports ActiveX Designer Runtime Support - craxdrt.dll - in VB code) ? In this last case, it is possible to manipulate every object of the report before launching it. Objects such as parameters can then be updated according to your needs.
As a simple example of such runtime update, my report printing routine will allways check if there is a field named "printedBy" in the report. In case this field is found, its value will be settled to the the domain name of the user that requests the report and will be printed out.
At an higher level, you can even reshape the report SQL string to add specific filters that can be inherited from your code. By doing so you might not even need parameters anymore: let your code add the filtering values 'on the fly'
EDIT: some code examples:
(m_rapport is a CRAXDRT.report object, ActiveSession is my current session object)
If m_rapport.ParameterFields.Count > 0 Then
For i = 1 To m_rapport.ParameterFields.Count
If m_rapport.ParameterFields(i).Name = "{?PUB_DateDebutPeriode}" Then
m_rapport.ParameterFields(i).AddCurrentValue CDate(DateValue(sessionActive.dateDebutPeriode))
End If
If m_rapport.ParameterFields(i).Name = "{?PUB_DateFinPeriode}" Then
m_rapport.ParameterFields(i).AddCurrentValue CDate(DateValue(sessionActive.dateFinPeriode))
End If
If m_rapport.ParameterFields(i).Name = "{?PUB_id_Personne}" Then
m_rapport.ParameterFields(i).AddCurrentValue StringFromGUID(clientActif.id_Personne)
End If
Next i
Endif
I also have another function to change report's datasource at runtime, so that reports can be executed on different servers/locations.
Read my posting Crystal Reports: Named-Date-Range Parameters. Maybe you'll be able to leverage this technique for your purposes.