Link to home
Start Free TrialLog in
Avatar of billinb
billinbFlag for United States of America

asked on

Problem with Refresh button on Crystal subreport hits database despite...

We have a mainj report that passes a filter to a subreport, and the problem currently is that when the user clicks the refresh button, it queries the database.  We don't want this. We have the Process options for scheduling set to 'refresh hit database' attribute = false.  This was configured by unchecking the 'report returns current data' box, and 'clients share'.  The report currently uses its Teradata connection and recordset through a command saved to the repository.

This has become a major problem, and we can't seem to find the recipe to stop the refresh button from hitting the database.  Any help appreciated, and I will gladly send files and code.
Report Options:  Save Data with report, unticked verify on first
Options:  unticked verify on first
Schedule  unticked 'returns current data' and 'clients share'.
Subreport passed parameter to conditional suppression in latest version, though we tried filtering via record selection as well.
 
We have not yet tried repository BV connections, though that may be a next desparate step.

Open in new window

Avatar of joshnuitari
joshnuitari

Hey billinb,

I am just wondering a few things about your crystal reports issue.  Are you using Crystal itself to run the reports, or are you using a .net / Java / language of choice program to run these reports?  

If you are using something like .net, I have run across this myself.  What I did to fix this, was I supplied a Dataset to the Crystal Report and therefore did not need to requery data for subreports etc.  You can also do this by passing in an XML File into the report with a schema as well, but if you are just using crystal itself, AFAIK, it will always requery the DBMS to get the data.  

Let me know a little more about your solution so I can help.  

Josh
Avatar of billinb

ASKER

Hi Josh, thanks for your reply.

Actually I'm not using .net, but had started to realize before looking at your response that I need the main report bound to some sort of disconnected dataset.  I used Select User() in the Command to get started, the next step I presume will be to create an xml file that can be used for the data source.

There are three geographical, hierarchical fields in addition to the date parameters that need to get passed up from a (newly created) subreport to Shared scope variables, and back to the 2nd Subreport with the information to be linked according to the Login ID of the end-user.

Am I going to have to set the switch to attach and re-link the subreport upon opening of the main report, I wonder?
<?xml version="1.0" encoding="utf-8"?>
<root>
  <Admin LoginFor="Administrator">
    <logged>Administrator</logged>
  </Admin>
</root>
 
-----------------------
 
<?xml version="1.0" encoding="utf-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="root">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="Admin">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="logged" type="xs:string" />
            </xs:sequence>
            <xs:attribute name="LoginFor" type="xs:string" use="required" />
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>

Open in new window

Avatar of billinb

ASKER

Why is it looking for a local xml file and not the file on the CMS server?
Avatar of billinb

ASKER

(Ignore the previous post -- I forgot to untick '..always prompt...'

Now the problem is that the rpt can't  grab a connection when scheduled.  I have a Business view with Elements for Both subreports.  

I think I might have to give the '... attach subreport on open ... ' option a try, as a desparate attempt.

It works fine from Crystal Reports running locally, the problem appears to arise when scheduled.

Bill
 Status: Failed  
  Printer: The instance is not printed.  
  External Destination: None  
  Data Refresh Settings:  Use the server defaults.  
  Start Time: 11/26/07 5:30:41 AM  
  End Time: 11/26/07 5:30:46 AM  
  Server Used: Our.reportjobserver  
 
 Error Message: Failed to open the connection......rpt etc etc. 

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of joshnuitari
joshnuitari

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of billinb

ASKER

I see now -- what you do is create a disconnected dataset for all of the reports, including subreports.  Then you presumably open to this disconnected set.  Am I correct so far?  You schedule the subreports to be run?  The main report must then attach to the subreports on open?  It sounds like the right path to be on, at any rate.  I had created an xml file with just one field, for the main report, thinking that would need be the only disconnected set.  Am I understanding correctly?