Link to home
Start Free TrialLog in
Avatar of bryanford
bryanford

asked on

How to use query's in Crystal reports passing parameters

Hello,

I have been thrown into a task at work and I have had no experience with it.

I have a database of Articles with an Article ID and a query to return an article by entering the article ID in a parameter box.

My company want to move to an executable front end with the access backend because they want to use it on machines without access installed.

Basically, I need some guidance on how to create a crystal report showing data from a query where an ID can be passed from a datagridview on another form. (Hope that makes sense)

I am using VS2005 Professional edition.

I only have minor knowledge of VB

I already have a datagridview that shows a list of articles with a detail button. When this is clicked I want it to load the crystal report showing the data from that item.

Bryan
Avatar of frodoman
frodoman
Flag of United States of America image

Download the sample applications here: http://support.businessobjects.com/communityCS/FilesAndUpdates/vbnet_web_samples.exe.asp

or here for Windows apps:
http://support.businessobjects.com/communityCS/FilesAndUpdates/vbnet_win_samples.exe.asp

They're based on VS2003 but the same code should work.  There are several samples in there about passing parameters to a report.

I'm assuming you know how to design the report so that it pulls data based on the parameter and what you need help with is passing the parameter from the application?  If that assumption is wrong let me know and I can give help on the other end of it.
Avatar of bryanford
bryanford

ASKER

ive been thinking about it and maybe i am not going the right way about this.

Basically, my project is a really basic knowledgebase with articles, and the part that i am stuck on is displaying an article.

When the user clicks on a detail button in a datagridview from a different form, I need the article to come up containing all the data.

The problem I am having is that I cant use a form with labels because the text length can vary and can cause overflow problems. This is why i thought a report would be better but playing around in the designer sort of says this wont help me either.

Do you know the best way to show this kind of data? We have an internal web version of the knowledgebase and I would like it to look like this: http://www.bryanford.info/screenshot.jpg

Each heading, Title, Problem, Cause, Solution, etc is a different field in the database.

Thanks
Bryan

There are several approaches to this that I can think of.

1) Use banding in a heirarchal datagrid so users can drill into the knowledge base and see it all within the grid
2) Use a form with labels and move the labels as needed based on the length of the text (assuming this is a Windows application) or use a form with flowlayout the automatically position the dynamic elements (for a Web application)
3) Use a Crystal report with on-demand subreports.

Option 1 & 2 are .Net application solutions and although I can help somewhat they are better addressed in one of the .Net forums.

For option #3 you basically create a report listing the articles and create a subreport that displays the article content and is linked to the main report by article number (or title or whatever field is unique).  You make the subreport an on-demand type so it doesn't display in the main report but will open when the link in the main report is clicked.  Within the subreport you can use the 'can grow' property to resize the fields as needed and place fields in separate details sections to avoid overlap.

If you need additional help with option #3 I'm happy to assist.

frodoman
Option 2 or 3 sounds the best way to go, however I must stress that this has to be idiot proof. (Its a windows application that is an offline version of our knowledgebase so the elderly can get help before calling our call centre).

So basically, what I am trying to say is that I would like to keep the datagridview form as the startup, then show the report by clicking on the detail button next to that article.

If option 3 still fits under this, would you be able to help me out?

Thanks for your help so far.

Bryan
ASKER CERTIFIED SOLUTION
Avatar of frodoman
frodoman
Flag of United States of America image

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
did as you said and does the job well enough :)

thanks very much