Generate on-the-fly Report/Print

Arg81

Well-known member
Joined
Mar 11, 2005
Messages
949
Location
Midlands, UK
Programming Experience
1-3
Hi Guys,

I'm trying to do the above.
This is achived on any of the search forms.

Basically I want to pass a parameter (the ID Field) to a columnar report (is this possible in Crystal?) and print. Either that or print straight from the form using a template.

The problem I have is that my form is split into two tabs - one the master table, the other the child.

I need to display data from both on a report.

I've tried creating a crystal report but it keeps doing it tabular. I ONLY WANT TO CREATE A REPORT FOR 1 RECORD.

This problem is hard to explain without showing any graphics, basically I want it so that the user can quickly print the details off and hand to a customer, or save as a pdf and email to the customer. But it needs to be professional, so printing straight from the form is not a good idea....

Any advice much appriciated!!

cheers
Luke
 
I've done it. Damn aweful but I've done it.

Basically create report from scratch (no wizard), and when you drag the fields down to the detail level, cut the header from "page header", and paste in details next to referenced field.
Then add parameter field for ID so that only one record is shown at any one time.

Now I've got to figure out how to do a manual drill down so I can show the child data for it!!!
 
New Problem

OK, now I have a weird issue.

I use xml files as my connection to the database(s) on the server. I've then set up classes that read the xml file(s).
This way any user that connects to the system is using the correct connection settings.

When I export my report to file, after it is complete I then get errors with the connection file.

Error:
Could not find file "%FileSaveLocation%/csConnection.xml" (where FileSaveLocation = the location selected to export the file to).

On my form load, I use the following code;

VB.NET:
conDatabase.ConnectionString = DatabaseDB.GetConnectionString
conDatabase.open
daDatabase.fill(DataSet.DataTable)
conDatabase.close

The class used to read the xml file is coded as;

VB.NET:
[size=2][color=#0000ff]Imports[/color][/size][size=2] System.Data.SqlClient

[/size][size=2][color=#0000ff]Imports[/color][/size][size=2] System.Xml

[/size][size=2][color=#0000ff]Public[/color][/size][size=2] [/size][size=2][color=#0000ff]Class[/color][/size][size=2] databaseDB

[/size][size=2][color=#0000ff]Public[/color][/size][size=2] [/size][size=2][color=#0000ff]Shared[/color][/size][size=2] [/size][size=2][color=#0000ff]Function[/color][/size][size=2] GetConnection() [/size][size=2][color=#0000ff]As[/color][/size][size=2] SqlConnection

[/size][size=2][color=#0000ff]Return[/color][/size][size=2] [/size][size=2][color=#0000ff]New[/color][/size][size=2] SqlConnection(GetConnectionString)

[/size][size=2][color=#0000ff]End[/color][/size][size=2] [/size][size=2][color=#0000ff]Function

[/color][/size][size=2][color=#0000ff]Public[/color][/size][size=2] [/size][size=2][color=#0000ff]Shared[/color][/size][size=2] [/size][size=2][color=#0000ff]Function[/color][/size][size=2] GetConnectionString() [/size][size=2][color=#0000ff]As[/color][/size][size=2] [/size][size=2][color=#0000ff]String

[/color][/size][size=2][/size][size=2][color=#0000ff]Dim[/color][/size][size=2] XmlReader [/size][size=2][color=#0000ff]As[/color][/size][size=2] [/size][size=2][color=#0000ff]New[/color][/size][size=2] XmlTextReader("csDatabase.xml")

[/size][size=2][color=#0000ff]Return[/color][/size][size=2] XmlReader.ReadElementString("Connection")

[/size][size=2][color=#0000ff]End[/color][/size][size=2] [/size][size=2][color=#0000ff]Function[/color][/size]
[size=2][color=#0000ff][/color][/size] 
[size=2][color=#0000ff]
[/color][/size]

Does anyone have any ideas??

cheers
Luke
 
Back
Top