Showing posts with label crystal. Show all posts
Showing posts with label crystal. Show all posts

Tuesday, March 27, 2012

Getting 20533 Error as a result of subreports.

I am using VB6 with crystal reports version 8.5 (the OCX) and Access (Jet) database.

I have created a report which works fine on my dev machine and am trying to deploy to another machine.
When the report is run on the other machine an error 20533 Unable to open database error is received.
The report has an embedded subreport, which if I remove the subreport, works fine.
I have validated the database for both the main report and the subreport.

Here is the code I am using to run the report.

With MDIMain.CrystalReport
.ReportFileName = App.Path & "\reports\Summary.rpt"

.RetrieveDataFiles
Do Until .DataFiles(xCntr) = ""
.DataFiles(xCntr) = gSystem.DB_Path
xCntr = xCntr + 1
Loop
.SelectionFormula = "{OrderHeader.OrderID} =" & rsOrder("OrderID") '{?OrderID}
.ReportTitle = gSystem.Company_Name
.Action = 1
End With

I'm at a loss... any help would be apprieciated. Thanks.Hi all... I figured out what the issue was. It was fixed with the following code that sets the database location for the subreport.
I have posted the code fix for anyone else that may run into this issue.

Thanks to all that took a look at this for me.

With MDIMain.CrystalReport
.ReportFileName = App.Path & "\reports\Summary.rpt"
.RetrieveDataFiles
Do Until .DataFiles(xCntr) = ""
.DataFiles(xCntr) = gSystem.DB_Path
xCntr = xCntr + 1
Loop
.SelectionFormula = "{OrderHeader.OrderID} =" & rsOrder("OrderID")
.ReportTitle = gSystem.Company_Name

.SubreportToChange = "Selected Options"
.DataFiles(0) = gSystem.DB_Path

.SubreportToChange = ""
.Action = 1
End With

Friday, March 9, 2012

Get the complete SQL Query

Hi !!!

I was told to generate in HTML the content of a crystal report, but without using Crystal Reports... The report is feeded from a sql server view, but inside the report there are many grouping and summarizing fields, so it's very difficult for me to build the sql query to feed my HTML report...

I'd like to know if there's a way to obtain (programatically or not) the complete SQL statement (that is, the original query from datasource plus any modification done in the crystal report such as grouping and summarizing).

Thank you !!!if u have crystal reports installed, open rpt file and
click database menu select show sql query.
U can see the rpt query.

regarding summary fields, u need to find it in rpt, in group footers or group headers.

Hope it helps|||Thank you sraheem !

The "show sql query" just shows the datasource sql query, but not the final sql that is built using that datasource AND grouping and summarizing fields...

Maybe it's not possible to obtain that final sql query ?

Thanks for help !

Sunday, February 19, 2012

Get Page Count of Crystal Report in C#

Hi,
I am displaying my crystal report in a Crystal Report Viewer.
How can I get the value of the number of pages in the Crystal Report?
thank you.
CRWhen you design the Crystal Report, you can go to Insert --> Special
Fields..., you can select either Page N of M, or Total Page Count.
Hope this will help.
Perayu
"CodeRazor" <CodeRazor@.discussions.microsoft.com> wrote in message
news:3C96E5C9-9AAC-4D45-8C3A-1D3DF25FB274@.microsoft.com...
> Hi,
> I am displaying my crystal report in a Crystal Report Viewer.
> How can I get the value of the number of pages in the Crystal Report?
> thank you.
> CR|||The only Crystal Reports related Micrsoft newsgroup is:
microsoft.public.vb.crystal
"CodeRazor" <CodeRazor@.discussions.microsoft.com> wrote in message
news:3C96E5C9-9AAC-4D45-8C3A-1D3DF25FB274@.microsoft.com...
> Hi,
> I am displaying my crystal report in a Crystal Report Viewer.
> How can I get the value of the number of pages in the Crystal Report?
> thank you.
> CR