|
I am Trying to print a page in web Application, I have written the below codes but geting an error
Public Event PrintPage(sender As Object, e As System.Drawing.Printing.PrintPageEventArgs)' is an event, and cannot be called directly. Use a 'RaiseEvent' statement to raise an event.
please some body Help me.
Protected Sub btnPrint_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnPrint.Click
Dim pd As PrintDocument = New PrintDocument
pd.PrinterSettings.PrinterName = printersList.SelectedItem.Text
pd.PrintPage += New PrintPageEventHandler(pd_PrintPage)
pd.Print()
End Sub
Public Sub pd_PrintPage(ByVal sender As Object, ByVal ev As PrintPageEventArgs)
Dim g As Graphics = ev.Graphics
Dim font As Font = New Font("Arial", 16)
Dim brush As SolidBrush = New SolidBrush(Color.Black)
g.DrawString("Hello Printer!", font, brush, New Rectangle(20, 20, 200, 100))
End Sub
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
If PrinterSettings.InstalledPrinters.Count <= 0 Then
Else
Dim printer As String
For Each printer In PrinterSettings.InstalledPrinters
printersList.Items.Add(printer.ToString())
Next
End If
End If
End Sub
|
|
|
|
|
You do know that this will print to the printers available to the webserver and not those necessarily available to the client (just making sure)?
|
|
|
|
|
Add event handler using
AddHandler pd.PrintPage, AddressOf pd_PrintPage
Public Sub pd_PrintPage(ByVal sender As Object, ByVal ppeArgs As PrintPageEventArgs)
End Sub
|
|
|
|
|
Public Sub New()
InitializeComponent()
End Sub
Private Sub PrintButton_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles PrintButton.Click
Dim pd As New PrintDocument()
AddHandler pd.PrintPage, AddressOf Me.pd_PrintPage
pd.Print("My Map")
End Sub
Private Sub pd_PrintPage(ByVal sender As Object, ByVal e As PrintPageEventArgs)
e.PageVisual = FarmImage '(name of the control that contain image)
End Su)
|
|
|
|
|
Hi
This is Arunvijay , in my project have to add a row at runtime in Gridview using JQuery
Pls help me to solve this problem
ArunVijay
|
|
|
|
|
Hi there,
I have problem regarding grid view.I have a page in which there are two Text Boxes who's max length is set to 50.I entered 50 alphabets in both the field and save it.After saving the data when I view that data at that time the size of grid became extremely large because of these two fields.I want to know how to reduce the size of grid.
Thanks,
|
|
|
|
|
use Wrap Property and set Warp="true"
cheers,
Abhijit
|
|
|
|
|
Hi abhijit thanks for reply.
I tried with setting this property but it works only in case when there is space in between two words if the word didn't have space then it won't work.
What to do now ?
Thanks
|
|
|
|
|
For example of wrapping check the Link[^]
You also can do one thing also.Just set the width of the column as you want.Then the exceeded charachters will come in next line.
Cheers!!
Brij
|
|
|
|
|
How to import excel file and display the contents of the excel file in a gridview using c# and asp.net.
Thanks in advance....
|
|
|
|
|
|
in case of asynchronous postback my check for
ispostback on page load does not work
i want to put another check for if asynchronous postback happend can any one guide me how????
umerumerumer
|
|
|
|
|
One thing you can do,in asunc postback pass a special value as a querystring and at the time of pageload ,check whether that querystring has any value or not and accordingly u'll get to know your answer.
Cheers!!
Brij
|
|
|
|
|
IsPostBack should work...
|
|
|
|
|
I've a Repeater which contains WebUserControl. Web user control has a property and FormView. The value of property is used in the Select paramater for FormView.
Problem is ItemInserting event of FormView is not firing, hence resulting no any entry of the new record.
Control Hierarchy is as following:
Page
|-- Web User control
| |-- Repeater
| | |-- Web User control (This has a property also)
| | | |-- FormView
NOTE: Repeater has only 1 record and is must to use the repeater.
Any solution to this problem?
Regards
Aftab Sindhi
.NET Application Developer
U.A.E
|
|
|
|
|
Hi all
I have one page.
my design is :I have one table,it contains tancontainer,it contains tabpanel,it contains updatepanel,it contains table,it contains textbox.
How can i fetch value of that textbox in c#.net?
Pls if u have any solution,pls reply me.
Thanks
monika
|
|
|
|
|
what is the issue in fetching the value from textbox?
I think it can be accessed from codebehind by its ID only.
Cheers!!
Brij
|
|
|
|
|
Hello,
I'm using Reportviewer control to show the SQL server reports in asp.net page. It is working fine and showing the reports properly.
But, if we enter page number in page number text box of report viewer control and press enter it is showing current page only but not the required page.
do we need to write any page navigation event for this functionality explicityly?
I have also written the code for pagenavigation event, it didn't work out even.
following is the piece of code I wrote in .cs page.
protected void ReportViewer1_PageNavigation(object sender, Microsoft.Reporting.WebForms.PageNavigationEventArgs e)
{
ReportViewer1.CurrentPage = e.NewPage;
}
Any help would be highly appreciated.
Thank you,
Raheem MA
|
|
|
|
|
Hi, did you find a solution to this?
I did find out if you use it in Synchronous mode (AsyncRendering="false") the Paging and Find stops working...
Let me know if you find a solution to this. Thanks!
|
|
|
|
|
i have used crystal report in my application
while using on server along with .net freamwork ihave install crystal report ?
or it comes with freamwork
|
|
|
|
|
you will find all the usefull controls related to crystal reports in .net bydefault.....
umerumerumer
|
|
|
|
|
hello,
As per my knowledge, while uploading into the server, you have to install crystal report.
Pinna
|
|
|
|
|
hii Actualy , i have set one variable value in Appsetting tag, now i need to access the value of that variable in my classic Asp page, can anyone tell me the proper way to access the value from web.config in classic asp. Although i can access that value in the ASP.net very easily
please help me out
|
|
|
|
|
web.config is a normal XML file and you can open it using ASP code and look for the required node. Check this[^] article which explains reading XML file.
|
|
|
|
|
How to populate values table of one feild as dropdown list c# code in a windows form dotnet.
modified on Tuesday, December 30, 2008 4:18 AM
|
|
|
|