billy_bob169 Posted February 7, 2003 Posted February 7, 2003 I have managed to load a disconnected dataset, which is then used to populate my datagrid, but now I must find a way to print it all. When I say all, it entails multiple user text box inputs, and the datagris/datatable that is derived from those inputs. Is there anyway to write a blank report in crystal, and pass values to formulas within the report from visual basic? Or am I better off writing everything to a text file, then sending that to a printer? I would really like to include a graphic on the printed page, but I am open to suggestions of an kind. Thanks.... Quote I'd rather be riding than working
Moderators Robby Posted February 7, 2003 Moderators Posted February 7, 2003 Here's one way of doing it, it is a lot of code and maybe not as easy as crystal.2-printtable.zip Quote Visit...Bassic Software
billy_bob169 Posted February 7, 2003 Author Posted February 7, 2003 I'll check it out... Quote I'd rather be riding than working
billy_bob169 Posted February 10, 2003 Author Posted February 10, 2003 I tried what Robby recomended, but the code gets pretty ugly, and for some reason, some of the info that shows in the print preview, doesn't print. It is info that is within a loop. Any suggestions or other alternatives? Quote I'd rather be riding than working
Moderators Robby Posted February 10, 2003 Moderators Posted February 10, 2003 Yeah it is ugly, but it should print whatever you see in the preview, I don't know much more than that. Quote Visit...Bassic Software
billy_bob169 Posted February 10, 2003 Author Posted February 10, 2003 I am looping through a data table to create rows and columns, and they show in the prview window, but they aren't printing. I am not quite sure what is going on yet, but I will post again when I figure it out... Quote I'd rather be riding than working
billy_bob169 Posted February 10, 2003 Author Posted February 10, 2003 I tried printing the version that you included, but it only prints the headings...ISBN, Title, & Author(s). Does it work on your PC??? Quote I'd rather be riding than working
Moderators Robby Posted February 10, 2003 Moderators Posted February 10, 2003 Hmm, I had previously only prviewed the report, I tried to print it and you're right, it only prints the headings. I'll play around with it and post back in a few minutes. Quote Visit...Bassic Software
Moderators Robby Posted February 10, 2003 Moderators Posted February 10, 2003 The idiot that put this sample together (not me) forgot to reset the itm count whent he preview is finished. I'll fix it in a sec. Quote Visit...Bassic Software
Moderators Robby Posted February 10, 2003 Moderators Posted February 10, 2003 easy solution... Reset the itm when the preview is finished (as well as the actual print page) Place the following in your code. Private Sub PrintDocument1_EndPrint(ByVal sender As Object, ByVal e As System.Drawing.Printing.PrintEventArgs) Handles PrintDocument1.EndPrint itm = 0 End Sub Quote Visit...Bassic Software
billy_bob169 Posted February 10, 2003 Author Posted February 10, 2003 Works Great!!! Thanks man... Quote I'd rather be riding than working
lpmonsterw Posted May 27, 2003 Posted May 27, 2003 Is there any C# code about printing datagrid? Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.