Solved

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

Posted on 2007-11-25
6
1,089 Views
Last Modified: 2010-04-21
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

0
Comment
Question by:billinb
  • 4
  • 2
6 Comments
 
LVL 1

Expert Comment

by:joshnuitari
ID: 20348102
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
0
 
LVL 1

Author Comment

by:billinb
ID: 20348751
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

0
 
LVL 1

Author Comment

by:billinb
ID: 20348975
Why is it looking for a local xml file and not the file on the CMS server?
0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
LVL 1

Author Comment

by:billinb
ID: 20349691
(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

0
 
LVL 1

Accepted Solution

by:
joshnuitari earned 500 total points
ID: 20353591
You might need to reconnect the sub report, but most likely not.  

What I do for report development is this...  

I create the report while physically connected to the Database, I then create a XML Schema of the Data I need and I use that one Data source for the main report and all sub reports.  The linking should automatically stay in tact as long as the column names remain the same and keys are respected in the schema.  

As for the XML Error above I do not know, I have always supplied a DataSet to the report through the CrystalReports API.  What language are you using for this report, or is it stand alone and not in Java/C#/VB/whatever?
0
 
LVL 1

Author Closing Comment

by:billinb
ID: 31410897
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?
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

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 …
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

778 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