[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Check for DataSource before sub report load

Posted on 2004-09-21
8
Medium Priority
?
475 Views
Last Modified: 2008-03-03
Hi,
I am trying to build a report that has multiple subreports.  The datasource for the sub reports is a series of CSV files (using an odbc connection).  The csv files are created by a third party program that performs exports to csv.  If the export is run by the users and there is no data it creates an empty csv file.  That file is then read by Crystal Reports (8.5) and the sub report fails. The sub reports called after it also fail.  I am wondering if there is a way in Crystal Reports to create a check for the datasource before the sub report loads.  It would be ideal if I could check and if the data source does not exist cancel the load of that subreport, thus allowing a load of the next subreport.

Is this possible in Crystal reports?  I have seen the Alert feature, but I am not sure how to check for the health of the data source.

Any help you could give would be much appreciated.

Casey
0
Comment
Question by:Casey Santos
[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
  • 3
  • 2
  • 2
8 Comments
 
LVL 101

Expert Comment

by:mlmcc
ID: 12119818
I can't think of any way to do that without using some kind of front end application or perhaps another csv files that has the count of the records in the various other csv files.

You could then use that information to suppress a given subreport.

mlmcc
0
 
LVL 10

Accepted Solution

by:
ebolek earned 100 total points
ID: 12122121
You can simple do it in an application like this

1. Create  windows or web form
2. Insert a crystal web/windows viewer to the form
3. Create a dataset and use that dataset as your report;s datasource.
4. Load the dataset with data
5. You cehck if the report's dataset is empty. If it is you exit the application, if not bind the datset to the report documeny and load the dataset tothe reportviewer.

Regards
Emre
0
 

Author Comment

by:Casey Santos
ID: 12122344
I am avoiding using a separate application because the Crystal Report file already is being used through a viewer in the Third Party application.  We would like to keep it as integrated as possbile for the users.


mlmcc, I would be interested to know how you would use a separate CSV file to count the records in the other files.  How would you suppress the subreport then?

Thanks,
Casey
0
Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

 
LVL 10

Expert Comment

by:ebolek
ID: 12122399
Good luck
0
 
LVL 101

Assisted Solution

by:mlmcc
mlmcc earned 400 total points
ID: 12122542
As ebolek says, this may be difficult.  I will need to think this through and need more information

First - I suspect you cannot change the exporting routines.  

Is there a main report that has a dataset?  If so is there any indication in that data that a subreport is empty? I doubt it.

How many subreports?  Is this a single report or is this something you want need for many reports?

Main basic idea is to use variables which are set from the new dataset.  The variables are then used to suppress a subreport if the dataset is empty.

Can you try something to see if this idea might work?
Take a set of the csvs with a known empty dataset.
Suppress the related subreport and see if the report runs.

mlmcc
0
 

Author Comment

by:Casey Santos
ID: 12128313
mlmcc, I think you have got it.  We have tried to surpress one of the subreports and then emptied the csv file.  The entire main report runs and skips the surpressed subreport.  So now we are going to create a different csv file datasource that reads all of the other csv files, checking them for data.  A flag will be set for each csv file that is missing data.  We will then use the csv file with these flags to set the surpression of each of the respective subreports.  We will do this tomorrow and let you know how it goes.

Thanks,
Casey
0
 
LVL 10

Expert Comment

by:ebolek
ID: 12338694
I think both mlmcc and I gave the right answers. He could use both explanations so I recommend mlmcc & ebolek

Comment from ebolek
Date: 09/22/2004 05:31AM PDT
Comment from mlmcc
Date: 09/22/2004 06:20AM PDT
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

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 …
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…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

650 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