Solved

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

Posted on 2007-11-25
6
1,093 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

733 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