Solved

SQLQueryString - where to find

Posted on 2004-09-02
6
227 Views
Last Modified: 2008-01-09
Hi all

Have downloaded a trial copy of CR10 to use within .NET. I have a page which reads a session based xml document containing the report file and any parameters to pass in. One of the reports that will be loaded in the viewer is causing a bit of a headache. It takes 13 parameters, but needs to ignore any blanks and link in an additional table when one is set to a certain value (for a major speed boost). This can't be done 'normally' and the report takes a ridiculous amount of time to run. I have used a dataset in the past, which works very quickly as I can create a very efficient SQL statement based on the parameters in the xml. Unfortunately, I have just been informed that  our customers all have different criteria for what they want displayed (even though it is invoked from the same page). So I can no longer use a dataset. The plan now is to create the customers reports with no selection criteria and then manually change the where clause of the sql (all the query fields are in the same master table) at runtime. I have no problem with doing this, but I can't find the report class which contains the SQLQueryString - in the help file it gives no reference to the dll, namespace and class where the 'Report Object' can be found (their developer help is a pile of crap tbh). I've been using ReportDocument but it doesn't have this property anywhere. Can anyone advise me which class I should be using and what dll I need to reference in order to access it?

Thanks in advance.
0
Comment
Question by:Trotters
  • 3
  • 3
6 Comments
 
LVL 42

Expert Comment

by:frodoman
ID: 11962234
Why not just filter your dataset at runtime and pass it (or a subset of it) to the report as you've been doing?
0
 

Author Comment

by:Trotters
ID: 11962299
That would require code changes and a re-build every time it is deployed to a new customer or an existing client required output change. Reports can be easily updated, which is why I want to take this approach. It would be easy if the documentation was up to scratch.
0
 
LVL 42

Expert Comment

by:frodoman
ID: 11963489
In that case I believe you want the recordselectionformula:

   Report.RecordSelectionFormula = "{Orders.ID} = 1"

This isn't a direct change of the SQL, but the record selection is converted into the SQL's "where" clause so it should work for you need.

0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:Trotters
ID: 11963584
Thanks for trying, but I do need to edit the SQL. I have to reference another lookup table when a certain parameter is set, so the record selection cannot help with that. If it wasn't for that then yes I could just change the selection criteria. I just need to find the 'Report Object' class which this extract of the developer help is pointing at:

"A report corresponds to a print job in the Crystal Report Engine. When the report object is destroyed, or goes out of focus, it closes the print job. It holds on to Application Object. When a Report Object gets destroyed, it releases the application.

Access to the Report Object is dependent on the object variable you create. If the object variable goes out of scope, you will lose access to the Report Object and, therefore, the report. You may want to declare your Report Object variable as Global."
0
 
LVL 42

Accepted Solution

by:
frodoman earned 250 total points
ID: 11963659
As far as I know this just isn't possible.  I found that documented for CR9 ( http://support.businessobjects.com/library/kbase/articles/c2014702.asp ).  I haven't seen anything documented for 10 but since it wasn't supported in 9 and there's nothing to indicate otherwise I have to believe 10 can't handle it either.

I understand why you wanted this approach vs. recompiling for each client but unfortunately I believe that would be your only option to accomplish what you need.
0
 

Author Comment

by:Trotters
ID: 11963876
Cheers, since it has been present in reports since at least version 8.5 then as you say it's probably a limitation of their component. 'Advanced Developer Edition' my arse.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This is a video that shows how the OnPage alerts system integrates into ConnectWise, how a trigger is set, how a page is sent via the trigger, and how the SENT, DELIVERED, READ & REPLIED receipts get entered into the internal tab of the ConnectWise …

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now