I have an application, I want to print into a rich text box and make it pretty! I want to change size for the header and to change font of the header and then standard font for the body. Datatable1 is a monster select statement. It has six inner joins and two right outer joins. It returns 78 items which will all be on this form when I am done. This will end up being the final report to the customer and needs to look very nice. As you can see I am trying to pad stuff and everything to make it look good, but the right column is not straight. (rtb1 is my rich text box)
rtb1.SelectionAlignment = HorizontalAlignment.Center
rtb1.Text ="Me Company " & LF & " me division ." & LF & " me street" & LF & " Wichita, Kansas 67214" 'rtb1.FontStyle.Bold() With Me.Metaltest1DataSet.DataTable1
rtb1.AppendText(LF & LF &"ULTRASONIC INSPECTION REPORT" & LF & LF)
rtb1.SelectionAlignment = HorizontalAlignment.Left
rtb1.AppendText(" Customer: " & PrintLeftColumn(.Rows(0).Item(13).ToString))
rtb1.AppendText("Customer Number: " & .Rows(0).Item(62).ToString & LF) '62
rtb1.AppendText(" Part Number: " & PrintLeftColumn(.Rows(0).Item(22).ToString))
rtb1.AppendText("Quanity: " & .Rows(0).Item(3).ToString & LF)
rtb1.AppendText(" Material: " & PrintLeftColumn(.Rows(0).Item(63).ToString))
rtb1.AppendText(" Heat Treat: " & .Rows(0).Item(64).ToString & LF)
rtb1.AppendText(" P.O. Number: " & PrintLeftColumn(.Rows(0).Item(65).ToString)) 'rtb1.AppendText(" End With
strData = strData.Trim
strData +=" "
strReturnValue = strData.PadRight(80)
I had thought about vbtab, but when I went to that help page, it was all jibberish and all the code was run together in one big word wrap blob. totally confusing. it must be very nice and clean. This is what is returned to my customer's customer. This seems so simple, i feel I need to find a high school kid to show me how!!!! I am just totally brain locked on this. I tried writing graphically to the bit mapped object, but when it prints out, it is very fuzzy, so I figured to make a word document (rtb) and print it out.
Not that I have found..
What does everybody else do when they want to creat a paper from database variables???? Is RTB the answer or are people useing something better? I had thought about useing crystal reports, but have not had luck with it. I am pulling data from multiple tables.
I throw back to the days of vb5 and 6, and have not had high milage with crystal reports. I've used crystal reports when making something with the wizard and a single datatable. Is there a way to create a structure and pass a pointer to crystal reports?? can you use pointers in vb? OH yea, as first stated, my fields are filled in from multiple tables. I go to the work order, grab all my indexes then open each table and pull a few items based on the index, until all the data has been gathered, then poke it in to the respective place on the form.
work order -->WorkOrderTable(w/o #) ---> indexes for table_1(index), table_2(index), ..table _n(index) --->
MyStructure =========> CrystalReport1(&MyStructure)
Damn this "mark code block" is so hit or miss...sometimes it works other times it erases my entire post.
I usually use stored procedures or join the tables in the report. You can also pass a dataset to a crystal report. When going that route you design the report using an xsd of the dataset. Then through code you build up your dataset and assign it to the report document using the SetDataSource method. Then you can use a CrystalReportViewer control to preview the report document.