This project has moved. For the latest updates, please go here.

Winforms / Web

Jan 22, 2009 at 10:42 AM
Sorry if this is a stupid question and/or the answers is obvious!

Can I use this with Winforms or just ASP.Net?

Thanks,

MS
Coordinator
Jan 22, 2009 at 2:26 PM
Hi MS,

I have not used DoddleReport with WinForms actually but I see no reason why it would not work. The ReportWriters are able to write to any Stream, so you could very easily write a report to the filesystem or even possibly use some WinForms control to render the binary stream data (or HTML if you use the HtmlReportWriter).

Report r = new Report();
// Build report here

IReportWriter writer = new ExcelReportWriter();

using(FileStream fs = File.Create(@"C:\temp\myReport.xls"))
{
    writer.WriteReport(r, fs);
}
Jan 22, 2009 at 6:26 PM

I’ll give it a try and let you know.

Thanks.

From: mhidinger [mailto:notifications@codeplex.com]
Sent: 22 January 2009 05:26 PM
To: s24382508@tuks.co.za
Subject: Re: Winforms / Web [doddlereport:44919]

From: mhidinger

Hi MS,

I have not used DoddleReport with WinForms actually but I see no reason why it would not work. The ReportWriters are able to write to any Stream, so you could very easily write a report to the filesystem or even possibly use some WinForms control to render the binary stream data (or HTML if you use the HtmlReportWriter).

Report r = new Report();
// Build report here

IReportWriter writer = new ExcelReportWriter();

using(FileStream fs = File.Create(@"C:\temp\myReport.xls"))
{
writer.WriteReport(r, fs);
}

Read the full discussion online.

To add a post to this discussion, reply to this email (doddlereport@discussions.codeplex.com)

To start a new discussion for this project, email doddlereport@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com

Apr 3, 2010 at 3:04 PM
Edited Apr 3, 2010 at 3:04 PM

WinForms +1.

Did you use it in WinForms ??

If yes, could you please post how you did it, any sample ??

I'd like to use it in VB 2008 EE.

Thanks.

Oct 16, 2010 at 10:28 AM

Hi.

I'm trying to get to grips with DoddleReport in WinForms, but the first attempt hasn't been successful.

Here is what I wrote:

Dim dt As New DataTable
dt.Columns.Add("Name", System.Type.GetType("System.String"))
dt.Columns.Add("Age", System.Type.GetType("System.Int16"))
dt.Columns.Add("Height", System.Type.GetType("System.Int16"))
dt.Rows.Add("john", 37, 178)
dt.Rows.Add("mike", 42, 185)
dt.Rows.Add("eric", 41, 187)
Dim src As IReportSource
src = dt.ToReportSource

Dim r As New Report(src)
r.TextFields.Title = "Example"
Dim wr As IReportWriter = New HtmlReportWriter
Dim sfile As String = GetFilename("temp.html")
Using myStream As IO.FileStream = IO.File.Create(sfile)
Try
 wr.WriteReport(r, myStream)
Process.Start(sfile)
Catch ex As Exception
MsgBox(ex.Message & vbCrLf & ex.StackTrace)
End Try
End Using

This gives me an "object reference not set to an instance of an object" in the wr.writereport command - as if the report was never created. Does this have anything to do with the way I create the datatable?