Click here to Skip to main content
15,909,051 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralEXPORT PDF from VB.NET Pin
partt13-Oct-04 10:28
partt13-Oct-04 10:28 
GeneralRe: EXPORT PDF from VB.NET Pin
Jim Matthews13-Oct-04 11:03
Jim Matthews13-Oct-04 11:03 
GeneralRe: EXPORT PDF from VB.NET Pin
partt13-Oct-04 11:39
partt13-Oct-04 11:39 
GeneralRe: EXPORT PDF from VB.NET Pin
Jim Matthews14-Oct-04 3:12
Jim Matthews14-Oct-04 3:12 
GeneralRe: EXPORT PDF from VB.NET Pin
partt14-Oct-04 4:30
partt14-Oct-04 4:30 
GeneralRe: EXPORT PDF from VB.NET Pin
Jim Matthews14-Oct-04 5:27
Jim Matthews14-Oct-04 5:27 
GeneralRe: EXPORT PDF from VB.NET Pin
partt14-Oct-04 6:54
partt14-Oct-04 6:54 
GeneralRe: EXPORT PDF from VB.NET Pin
Jim Matthews14-Oct-04 8:11
Jim Matthews14-Oct-04 8:11 
partt wrote:
I didn't know I needed to make a template to pass to the .rpt template

if someone already made you a template file, what did they use to define the data definition of that template? that's the key... the underlying datasource (your dataset) needs to match the datadefinition of the report template file.

you have 9/10's of the work done really. here's basically step for step what you need to do. from the beginning:

1. decide on your data structure. whatever suits your needs for what you need to display to your user should do.

2. create the dataset either through code or through the xml designer in the vs.net ide.

3. either way you need to end up with a valid .xsd file.

(if you create your dataset through code then just step through the code to the point where it's populated and use the command window to perform a myDataset.WriteXml("outputfile.xsd", xmlwritemode.writeschema)) this will give you a file that you can then use to set the datadefinion of your cr template file.

4. Create a new crystal report template (or just open up the one that you already have) and set the datasource for the template = you newly generated .xsd file.

5. Create your report by dragging and dropping fields from your datasource onto the designer.

6. basically do what you did in your code above to load this report template into a reportdocument object and set the datasource = your dataset.

it's really not complicated. the most important thing is to make sure that the data structure that you are passing into the reportdocument object as the datasource matches what is defined in the report template.

if you have to make some changes to the datasource to add or remove a field, make sure you re-load the data structure back into the report template by right clicking the datasource node in the field explorer and clicking verify database. if they are off slightly you'll get some really generic errors such as 'report load failed', or 'query engine error'. such is life with crystal.

i hope this explains the process a little more clearly. if not you know where to find me...
Smile | :)



-jim
GeneralRe: EXPORT PDF from VB.NET Pin
partt14-Oct-04 9:35
partt14-Oct-04 9:35 
GeneralRe: EXPORT PDF from VB.NET Pin
Jim Matthews14-Oct-04 10:36
Jim Matthews14-Oct-04 10:36 
GeneralRe: EXPORT PDF from VB.NET Pin
partt15-Oct-04 5:14
partt15-Oct-04 5:14 
GeneralCreditcard validation Pin
lathashrik13-Oct-04 6:41
lathashrik13-Oct-04 6:41 
GeneralRe: Creditcard validation Pin
Colin Angus Mackay13-Oct-04 6:48
Colin Angus Mackay13-Oct-04 6:48 
Generalauto Launch after install vb.net Pin
Steve6913-Oct-04 6:11
Steve6913-Oct-04 6:11 
GeneralRe: auto Launch after install vb.net Pin
Anonymous13-Oct-04 9:07
Anonymous13-Oct-04 9:07 
GeneralRe: auto Launch after install vb.net Pin
Steve6913-Oct-04 23:26
Steve6913-Oct-04 23:26 
GeneralRe: auto Launch after install vb.net Pin
Anonymous13-Oct-04 11:16
Anonymous13-Oct-04 11:16 
Questiondata grid? Pin
unambiguos13-Oct-04 4:09
unambiguos13-Oct-04 4:09 
AnswerRe: data grid? Pin
Mekong River13-Oct-04 4:14
Mekong River13-Oct-04 4:14 
GeneralRe: data grid? Pin
unambiguos13-Oct-04 20:46
unambiguos13-Oct-04 20:46 
GeneralRe: data grid? Pin
Mekong River14-Oct-04 17:06
Mekong River14-Oct-04 17:06 
GeneralWriting DirectoryInfo() to XML File Pin
cwayman12-Oct-04 22:06
cwayman12-Oct-04 22:06 
GeneralRe: Writing DirectoryInfo() to XML File Pin
J4amieC13-Oct-04 2:02
J4amieC13-Oct-04 2:02 
GeneralRe: Writing DirectoryInfo() to XML File Pin
cwayman13-Oct-04 21:58
cwayman13-Oct-04 21:58 
GeneralRe: Writing DirectoryInfo() to XML File Pin
cwayman14-Oct-04 3:29
cwayman14-Oct-04 3:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.