473,766 Members | 2,060 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to set printername for Reportviewer from code (VS2005)?

Hello,

I need to print a report from the VS2005 Reportviewer control. My problem
is that I need to print to a tractor feed (dotmatix like) printer that is not
the default printer - for printing mailing labels (thousands of them). I can
set all the settings from the pagelayout button of the Reportviewer at
runtime, but that is a real hassel - set the margins, paper orientation,
papersize, printername. I tried using a deviceInfo type string like this:

// Build device info based on start page
deviceInfo = String.Format(
"<DeviceInf o>" +
"<OutputFormat> EMF</OutputFormat>" +
" <MarginTop>0.25 in</MarginTop>" +
" <MarginLeft>0.2 5in</MarginLeft>" +
" <MarginRight>0. 25in</MarginRight>" +
" <MarginBottom>0 .25in</MarginBottom>" +
" <StartPage>{0 }</StartPage>" +
"</DeviceInfo>", pageIndex+1);

but this uses streams for rendering which would require more coding than I
want. How can I set the page layout/printer/paper properties from code for
the Report viewer? How to do it the lazy/limited braincells way? I tried

PageSetupDialog ps1;
ps1 = New PageSetupDialog ;
ps1.PrinterSett ings.PrinterNam e = "\\NASPP14\T604 5";

but VS complained, besides how to I assign it to my RptViewer object? Or do
I need to go the deviceInfo/streams route?

Thanks,
Rich
Oct 19 '06 #1
1 4345
Install the same driver as another printer with a different printer name
then print though that printer name.

chanmm

"Rich" <Ri**@discussio ns.microsoft.co mwrote in message
news:11******** *************** ***********@mic rosoft.com...
Hello,

I need to print a report from the VS2005 Reportviewer control. My problem
is that I need to print to a tractor feed (dotmatix like) printer that is
not
the default printer - for printing mailing labels (thousands of them). I
can
set all the settings from the pagelayout button of the Reportviewer at
runtime, but that is a real hassel - set the margins, paper orientation,
papersize, printername. I tried using a deviceInfo type string like this:

// Build device info based on start page
deviceInfo = String.Format(
"<DeviceInf o>" +
"<OutputFormat> EMF</OutputFormat>" +
" <MarginTop>0.25 in</MarginTop>" +
" <MarginLeft>0.2 5in</MarginLeft>" +
" <MarginRight>0. 25in</MarginRight>" +
" <MarginBottom>0 .25in</MarginBottom>" +
" <StartPage>{0 }</StartPage>" +
"</DeviceInfo>", pageIndex+1);

but this uses streams for rendering which would require more coding than I
want. How can I set the page layout/printer/paper properties from code
for
the Report viewer? How to do it the lazy/limited braincells way? I tried

PageSetupDialog ps1;
ps1 = New PageSetupDialog ;
ps1.PrinterSett ings.PrinterNam e = "\\NASPP14\T604 5";

but VS complained, besides how to I assign it to my RptViewer object? Or
do
I need to go the deviceInfo/streams route?

Thanks,
Rich


Oct 20 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2290
by: Chris Botha | last post by:
I created a Web site using VS2005 and one of the Web forms has a ReportViewer control. This works great on the development computer itself. I then deploy to a computer with only the Framework 2.0 installed and not VS2005. Everything works, except when running the page with the ReportViewer, I get the following error: Could not load file or assembly 'Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral,...
4
4475
by: dgk | last post by:
VS2005. I've spent two days trying to figure out how to do a simple master/detail report using ReportViewer and am just about ready to punt. This is something that really should have been drag/drop/relationship but no. I've finally figured out that I need to use a subreport but I can't figure out how to set the datasource of the localreport object since it only seems to want a datatable and I have a function that is returning a list (of...
1
8559
by: Pieter | last post by:
Hi, In my application VB.NET 2005 application I placed a ReportViewer, and link it to a server-report: Me.ReportViewer1.ProcessingMode = Microsoft.Reporting.WinForms.ProcessingMode.Remote Me.ReportViewer1.ServerReport.ReportPath = "/myproject/DemandeDeCotation" Me.ReportViewer1.ServerReport.ReportServerUrl = New System.Uri("http://myserver/reportserver2005", System.UriKind.Absolute)
1
2051
by: Phil Barber | last post by:
Does anybody know why the Print button on the report viewer toolbar (VS2005) only shows for remote reports and not Local? Is there a way to get a print function(button) on the toolbar for local reports? if not what is required to get the remote reports setup and working? thanks Phil B
24
2841
by: Tony Girgenti | last post by:
Hello. Developing a Windows Form program in VS.NET VB, .NET Framework 1.1.4322 on a windows XP Pro, SP2. Before printing a document, i want to set the font to a font that is only available with the printer that i am printing to(Zebra TLP2844). When i open Word and look at the fonts available for the default printer, it does not show the fonts i want. If i cahnge the printer to the printer that
1
2004
by: Joe | last post by:
Hi, I developed a VB.NET Windows program that gets its data from an MS Access database and displays information via the ReportViewer component. This is using VS2005 with .NET 2.0. I sent it to my customer who loaded it on his target machine and received this error message: "'Microsoft.ReportViewer.WinForms, Version=8.0.0.0, Culture=neutral,
1
19328
by: beebob | last post by:
Hi all, I am sorry if I have posted this problem to irrelevant forum. I am working in C#, and I don't find any C# forum here. I hope someone here can help me to resolve my problem. Here is: I am working by using VS2005 and dotNet Framework 2.0. I have an ASP Content page, with one ReportViewer, and 5 RDLC files. This page contains a dropdownlist with 5 items, which if someone choose any one of them, they will see the report on the bottom...
0
1126
by: Rick | last post by:
Hy Guys!!! I've made a report using reportviewer control in VS2005, it gives me 35 pages (A4 size), i want to display just one page or continuos pages without have to press next button, i want to see all pages in just a screen, is it possible using reportviewer? I've made it using crystal reports (it has a property for), i don't find a property to do it with reportviewer, i can't use crystal, it should be reportviewer (it's more easy...
0
941
by: =?Utf-8?B?UmljaA==?= | last post by:
I just started getting this warning message when I publish apps that use the VS2005 Reportviewer Warning 1 The value of the 'PublicKey' attribute in 'Microsoft Visual Studio 2005 Report Viewer' does not match that of file 'C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bootstrapper\Packages\ReportViewer\ReportViewer.exe'. MyCustomProject I started getting this warning message after I updated my signing Assembly certicate (which...
0
9404
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10168
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10008
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9837
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6651
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5423
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3929
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3532
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2806
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.