By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,586 Members | 623 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,586 IT Pros & Developers. It's quick & easy.

Crystal viewer

P: n/a
Dear NG,

I have Crystal Reports working to a file and directly to the printer with
the following:

private void mnuInvRep1301_Click(object sender, System.EventArgs e)
{

ReportDocument report = new ReportDocument();

report.Load("C:\\database\\MCS-3-SQL\\MCS-3inC#\\INV\\Reports\\rpt1301.rpt")
;

//Send report to a file

//report.ExportToDisk(CrystalDecisions.Shared.Export FormatType.RichText,"C:\
\tmp\\CrystalOut.rtf");

//Send report directly to the default printer

report.PrintToPrinter(1, false, 0, 0);

MessageBox.Show("Crystal terminated normally");

}

I would like to use the Windows viewer. I have created Form1. I added the
ReportDocument to Form1. On a menu item click I would like to instantiate
the form to myForm and then use the form as follows:

myForm.ShowDialog();

How do I instantiate the form?

TIA - Bob (bo*@s-i-inc.com)
Nov 16 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Hi Robert,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need to view crystal report on a
windows form. If there is any misunderstanding, please feel free to let me
know.

As far as I know, if you need to view it on a windows form, you need to
place a crystal report viewer on the form, and assign the report document
report source to the viewer. Then you just use the following to show dialog
box.

Form1 myForm = new Form1();
myForm.ShowDialog();

Crystal Report is not supported by Microsoft. For more information related
to this issue please check the following link:
https://support.crystaldecisions.com

HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 16 '05 #2

P: n/a
Thank you Kevin,

That worked fine. I have a few formating issues, like landscape
orientation, but I am off and running. I have a lot of C# and Crystal
learning to do, but I am well on my way. Is Crystal Reports the best way to
integrate about 100 reports from a SQL database using C#?

Cheers,

Bob

Robert Schuldenfrei
bo*@s-i-inc.com
"Kevin Yu [MSFT]" <v-****@online.microsoft.com> wrote in message
news:4H*************@cpmsftngxa06.phx.gbl...
Hi Robert,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need to view crystal report on a
windows form. If there is any misunderstanding, please feel free to let me
know.

As far as I know, if you need to view it on a windows form, you need to
place a crystal report viewer on the form, and assign the report document
report source to the viewer. Then you just use the following to show dialog box.

Form1 myForm = new Form1();
myForm.ShowDialog();

Crystal Report is not supported by Microsoft. For more information related to this issue please check the following link:
https://support.crystaldecisions.com

HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 16 '05 #3

P: n/a
Hi Again,

I thought I could adjust the viewer properties without any further aid from
the NG, but I was wrong. When I print my reports to a file or directly to
the printer, the orientation is landscape. This was set in the report
itself using Designer | Printer Setup and setting the printer to landscape.
When I send the report to the viewer, using the statements listed below, the
lines are truncated because the viewer is defaulting to portrait
orientation. How can I change this viewer property? The book I am using is
Neil FitzGerald et. al., Using Crystal Reports 10. It is very good at
explaining Crystal, but is very brief on explaining the .NET material. As
ever, thank you in advance for your help.

Sincerely,

Bob

Robert Schuldenfrei
bo*@s-i-inc.com
"Kevin Yu [MSFT]" <v-****@online.microsoft.com> wrote in message
news:4H*************@cpmsftngxa06.phx.gbl...
Hi Robert,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need to view crystal report on a
windows form. If there is any misunderstanding, please feel free to let me
know.

As far as I know, if you need to view it on a windows form, you need to
place a crystal report viewer on the form, and assign the report document
report source to the viewer. Then you just use the following to show dialog box.

Form1 myForm = new Form1();
myForm.ShowDialog();

Crystal Report is not supported by Microsoft. For more information related to this issue please check the following link:
https://support.crystaldecisions.com

HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 16 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.