Click here to Skip to main content
15,845,785 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Sorry but i am new and i am trying to draw a simple line or rectangle into a report.
Is possible to do that?
Can someone give me an example, please?

Thanks in advance

What I have tried:

it's my first approach to reportviewer, so non ideas how to do that
Posted
Updated 21-Jul-22 10:27am
Comments
Gerry Schmitz 17-Jul-22 20:13pm    
You don't add it to the viewer; you'd add it to the report; depending on what that report "engine" supports: images and / or graphics commands.
tonj67 18-Jul-22 4:16am    
Thanks a lot Gerry for your reply...
i would like to add it to the report writing the code... if it's possible
Can you explain better what mean:
"depending on what that report "engine" supports: images and / or graphics commands."?

i had wrote this code but nothing appear on the report:

Dim g As Graphics = ReportViewer1.CreateGraphics
Dim mypen As Pen = New Pen(Brushes.Black, 50.0F)
g.DrawLine(mypen, 10, 10, 0, 10)
g = ReportViewer1.CreateGraphics

ReportViewer1.LocalReport.Refresh()
ReportViewer1.RefreshReport()

for sure i wrote "una schifezza" (in italian language)

Thanks in advance for your help
Gerry Schmitz 21-Jul-22 9:26am    
You make reference to the "report viwer"; but you say nothing about the "report" (file) or where it came from. The "report viewer" displays a "report FILE"; nothing more. It's during report "generation" when you typically use features of the report "engine" (e.g. certain "events") to add extras (e.g. comment "text boxes").
tonj67 21-Jul-22 16:56pm    
I try to explain you what i did, step by step.

i created an application to do some tests (windows form), then i had add one report (file report.rdlc) .
Into this report i have dragges one textlabel and created a parameter to fill with some words. the textlabel can be with the word "hello" or "hello world", so the lenght can be variable.
under this label i want draw one line like the lenght of the textlabel.
The file rdlc is into the application folder

Sorry but i feel stupid and not sure to have explained you so good. I do not find any event for the report.

Can i find some manual or example to get suggests how to do?

Thanks a lot

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900