CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums

MS SQL 2008 on ASP.NET Hosting
Free 3 Months



Zone: > NEWSGROUP > Asp.Net Forum > visual_studio.visual_studio_2005 Tags:
Item Type: NewsGroup Date Entered: 1/4/2007 6:12:40 AM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 4 Views: 107 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
5 Items, 1 Pages 1 |< << Go >> >|
jcwy
Asp.Net User
VS2005 Web ReportViewer client browser printing ??1/4/2007 6:12:40 AM

0/0

hi all,

As what I know there is no PRINT button in VS2005 web ReportViewer. But then microsoft do provide a way to render report in EMF for printing. I tried the sample code, but it looks like the printing job is occured at the printer attached to the server. What I want is the printing should be occured at the client printer. Anybody got idea on it ? Is it I missed up something from the sample code ?

Anyone has tried the microsoft EMF-rendering print sample code (for web) and can print at client printer ?

 Thank you.

 

johnzen
Asp.Net User
Re: VS2005 Web ReportViewer client browser printing ??1/4/2007 4:15:25 PM

0/0

oh, Javascript can do it.I have a demo.if you need my help.just add my MSN:[email protected] .I think it is very easy,and i hope it help.
jcwy
Asp.Net User
Re: VS2005 Web ReportViewer client browser printing ??1/5/2007 3:23:57 AM

0/0

johnzen:
oh, Javascript can do it.I have a demo.if you need my help.just add my MSN:[email protected] .I think it is very easy,and i hope it help.

I wonder how Javascript can do it. I will find it out from johnzen through msn. Thanks johnzen.

Anybody got idea how to do it too, kindly let me know. I really appreciate it.

Thank All.

regards,

Jcwy 

 

 

 

jcwy
Asp.Net User
Re: VS2005 Web ReportViewer client browser printing ??1/5/2007 3:37:43 AM

0/0

The sample code i tried is as below. Why set to printer "Microsoft Office Document Image Writer" ? Must set like that to be able to print at client printer ?

Imports System.IO
Imports System.Data
Imports System.Text
Imports System.Drawing.Imaging
Imports System.Drawing.Printing
Imports System.Collections.Generic
Imports Microsoft.Reporting.WebForms

Public Class Demo
    Implements IDisposable

    private m_currentPageIndex As Integer
    private m_streams As IList(Of Stream)

    Private Function LoadSalesData() As DataTable
        Dim dataSet As New DataSet()
        dataSet.ReadXml("data.xml")
        Return dataSet.Tables(0)
    End Function

    Private Function CreateStream(name As String, _
         fileNameExtension As String, _
              encoding As Encoding, mimeType As String, _
                  willSeek As Boolean) As Stream
        Dim stream As Stream = New FileStream(name + "." +  fileNameExtension, FileMode.Create)
        m_streams.Add(stream)
        Return stream
    End Function

    Private Sub Export(report As LocalReport)
        Dim deviceInfo As string = _
          "<DeviceInfo>" + _
          "  <OutputFormat>EMF</OutputFormat>" + _
          "  <PageWidth>8.5in</PageWidth>" + _
          "  <PageHeight>11in</PageHeight>" + _
          "  <MarginTop>0.25in</MarginTop>" + _
          "  <MarginLeft>0.25in</MarginLeft>" + _
          "  <MarginRight>0.25in</MarginRight>" + _
          "  <MarginBottom>0.25in</MarginBottom>" + _
          "</DeviceInfo>"
        Dim warnings() As Warning = Nothing
        m_streams = New List(Of Stream)()
        report.Render("Image", deviceInfo, _
              AddressOf CreateStream, warnings)

        Dim stream As Stream
        For Each stream In m_streams
            stream.Position = 0
        Next
    End Sub

    Private Sub PrintPage(sender As Object, ev As PrintPageEventArgs)
        Dim pageImage As New Metafile(m_streams(m_currentPageIndex))
        ev.Graphics.DrawImage(pageImage, ev.PageBounds)
     
        m_currentPageIndex += 1
        ev.HasMorePages = (m_currentPageIndex < m_streams.Count)
    End Sub

    Private Sub Print()
        Const printerName As String = "Microsoft Office Document Image Writer"

        If m_streams Is Nothing Or m_streams.Count = 0 Then
            Return
        End If

        Dim printDoc As New PrintDocument()
        printDoc.PrinterSettings.PrinterName = printerName
        If Not printDoc.PrinterSettings.IsValid Then
            Dim msg As String = String.Format(_
                 "Can't find printer ""{0}"".", printerName)
            Console.WriteLine(msg)
            Return
        End If
        AddHandler printDoc.PrintPage, AddressOf PrintPage
        printDoc.Print()
    End Sub

    Private Sub Run()
        Dim report As LocalReport = new LocalReport()
        report.ReportPath = "Report.rdlc"
        report.DataSources.Add(new ReportDataSource("Sales", LoadSalesData()))

        Export(report)

        m_currentPageIndex = 0
        Print()
    End Sub

    Public Overloads Sub Dispose() Implements IDisposable.Dispose
        If Not (m_streams Is Nothing) Then
            Dim stream As Stream
            For Each stream In m_streams
               stream.Close()
            Next
            m_streams = Nothing
        End If
    End Sub

    Public Shared Sub Main(args as string())
        Using demo As Demo = new Demo()
            demo.Run()
        End Using
    End Sub
End Class

jcwy
Asp.Net User
Re: VS2005 Web ReportViewer client browser printing ??1/8/2007 6:01:55 AM

0/0

Impossible to print at client printer through LocalReport at VS2005 ReportViewer Control ?

The only way is has to export to PDF/Excel first, then print the PDF/Excel file locally ?

No alternative way to print localreport at client printer ?

 

regards,

Jcwy 

 

5 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Pro SQL Server 2005 Reporting Services Authors: Rodney Landrum, Walter J. Voytek, II, Walter J. Voytek, Pages: 374, Published: 2005
Professional SQL Server 2005 Reporting Services Authors: Paul Turley, Todd Bryant, James Counihan, Dave DuVarney, Pages: 688, Published: 2006
Pro SQL Server 2008 Reporting Services Authors: Rodney Landrum, Shawn McGehee, Walter J. Voytek II, Pages: 424, Published: 2008
Programming SQL Server 2005: Prepare for Deeper SQL Server Waters Authors: Bill Hamilton, Pages: 571, Published: 2006
SQL Server 2005 Reporting Essentials Authors: Bill Hamilton, Pages: 0, Published: -1
Professional Visual Studio 2005 Team System Authors: Jean-Luc David, Tony Loton, Erik Gunvaldson, Christopher Bowen, Noah Coad, Darren Jefford, Pages: 700, Published: 2006

Web:
VS2005 Web ReportViewer client browser printing ?? - ASP.NET Forums VS2005 Web ReportViewer client browser printing ?? Last post 01-08-2007 1:01 AM by jcwy. 4 replies. Sort Posts: ...
VS2005 Web ReportViewer client browser printing ?? - ASP.NET Forums Re: VS2005 Web ReportViewer client browser printing ?? 01-04-2007, 11:15 AM ... Re: VS2005 Web ReportViewer client browser printing ?? 01-04-2007, 10:23 PM ...
ReportViewer Web Server and Windows Forms Controls Printing reports from the Windows Forms control uses the print ... For more information, see Browser Support for ReportViewer Web Server Controls. ...
CodeProject: Using the ASP.NET 2.0 ReportViewer in Local Mode ... When you use the Visual Studio 2005 ReportViewer web server control in your website, you will need to copy ... NET TreeView Control & the Client's Browser ...
TheMSsForum.com >> Reporting Svcs >> ReportViewer print issue ... Any thoughts? Thanks in advance! Dan Tag: ReportViewer print issue Tag: 78137 ..... Our developers currently use Visual Studio 2005 for web app development, ...
Visual Studio Magazine Online | Feature: Build Client-Side Reports ... VS 2005's new ReportViewer control and its built-in Report Designer enable smart -client and Web page designers to lay out, format, embed, export, and print ...
CodeProject: Using the ASP.NET 2.0 ReportViewer in Local Mode ... The server generates the report and then sends it to the client. .... When you use the Visual Studio 2005 ReportViewer web server control in your website, ...
Reportviewer Control (from VS 2005, in conjunction with SQL ... Help with Print button on report viewer not showing up! ..... In SQL Reporting Services in the web browser, this report displays fine, no problems. ...
ReportViewer control - Remote processing mode I have developed a web portal that uses ReportViewer web control to ... the client side. The asp.net page has been coded to automatically ...
"reportviewer" Search Results We encourage you to - and make it your default web browser; you can still use IE to view any web page ... Visual Studio 2005 Report Viewer controls support. ...




Search This Site:










session signout query

for user administration

authorization help

*urgent* - access is denied problem with asp.net 1.1 application

event validation: invalid character in a base-64 string

need to pass through user credentials into sql connection

cannot create user in asp.net configuration visual studio 2005 version2.0.50215.0

froms and windows authentication

sign in user

help in user log in

problems with getprofile, how to find out if profile dosent exist.

form authenticate specific pages of project

prevent account sharing

securing business components

user/pass box

system.io.filenotfoundexception: could not find file

displaying images from within a firewall?

do i need to modify sqlmembershipprovider?

get user data on login page

tip/ip filtering issue help.

wants to redirect to login page when full path of any page entered in browser without login

lack insight, how do i best implement membership, or should i forget about it and use session("")

cookies

problem with secured files using asp.net

how would i secure only 4 webforms from rest of site...

userid

users in my database; but roles in aspnetdb

setauthcookie(id, true) not persisiting

cannot hide a page in sitemap using roles

struggling with whether to call dispose() on sqlcommand and sqlconnection

  Privacy | Contact Us
All Times Are GMT