|
Dear All,
I am making web application using Asp.net C#(Visual Studio2005). And Sql server 2005 as a back End
I generated local mode report but as there was no printing option available . I assign printing feature to button click by exporting the data to EMF format and print
Now when I run it through IDE VS2005 then it does not show any error.
But when I run in through IIS in intranet it showing me this error
The process cannot access the file 'D:\Inventracksys\Inventorytracking Vendorwisereport_1.emf' because it is being used by another process
Where I am going wrong please guide me.
Code used are
Button click code
protected void Btnprint_Click(object sender, EventArgs e)
{
LocalReport report = new LocalReport();
vw_tranTableAdapter da = new vw_tranTableAdapter();
report.ReportPath = @"D:\Inventracksys\inventorytracking\Vendorwisereport.rdlc";
report.DataSources.Add(new ReportDataSource("tran_vw_tran", da.GetDataByvendor(RadioButtonList1.SelectedValue, DropDownListvendor.SelectedValue)));
export(report);
m_currentpageindex = 0;
Print();
}
Creating stream as
private Stream CreateStream(string name, string filenameextension, Encoding encoding, string mimetype, bool willseek)
{
Stream stream = new FileStream(@"D:\Inventracksys\Inventorytracking " + name + "." + filenameextension, FileMode.Create );
//Stream stream = new FileStream(name + "." + filenameextension, FileMode.Create);
m_streams.Add(stream);
return stream;
}
Exporting to EMF
private void export(LocalReport report)
{
string deviceInfo = "<deviceinfo>" + " <outputformat>EMF" + " <pagewidth>9in" + " <pageheight>12in" + " <margintop>0.25in" + " <marginleft>0.25in" + " <marginright>0.25in" + " <marginbottom>0.25in" + ""; Warning[] warnings; m_streams = new List<stream>(); report.Render("Image", deviceInfo, CreateStream, out warnings);
foreach (Stream stream in m_streams) stream.Position = 0;
}
Printhandler event
private void PrintPage(object sender, PrintPageEventArgs ev)
{
Metafile pageImage = new
Metafile(m_streams[m_currentpageindex ]);
ev.Graphics.DrawImage(pageImage , ev.PageBounds);
m_currentpageindex++;
ev.HasMorePages = (m_currentpageindex < m_streams.Count); }
printing option
private void Print()
{
const string printerName =
"Microsoft Office Document Image Writer";
if (m_streams == null || m_streams.Count == 0)
return;
PrintDocument printDoc = new PrintDocument();
printDoc.DefaultPageSettings.Landscape = true;
printDoc.PrinterSettings.PrinterName = printerName;
// lblerrmsg.Text = printDoc.PrinterSettings.PrinterName;
if (!printDoc.PrinterSettings.IsValid)
{
string msg = String.Format(
"Can't find printer \"{0}\".", printerName);
//MessageBox.Show(msg, "Print Error");
lblerrmsg.Text = "Print Error";
return;
}
printDoc.PrintPage += new PrintPageEventHandler(PrintPage);
printDoc.Print();
}
public void Dispose()
{
if (m_streams != null)
{
foreach (Stream stream in m_streams)
stream.Close();
m_streams = null;
}
}
Now when I run it through IDE VS2005 then it does not show any error.
But when I run in through IIS in intranet it showing me this error
The process cannot access the file 'D:\Inventracksys\Inventorytracking Vendorwisereport_1.emf' because it is being used by another process
Where I am going wrong please guide me.
Thanks
regards
imran khan
|
|
|
|
|
hi
i wanted to perform a search for records based on the date range specified by the user..
the input method is by way of calender extender(Ajax toolkit) which is in mm/dd/yyyy
before going to the web from i just queried the table using the query builder and it constructed a query
SELECT patient.*
FROM patient
WHERE (Dt BETWEEN CONVERT(DATETIME, '2006-08-09 00:00:00', 102) AND CONVERT(DATETIME, '2006-09-09 00:00:00', 102))
now how do i use the same query to the webform... also how will i display the results in a gridview control..
thx
Kunal
|
|
|
|
|
how is it possible to set the access rights and permissions for roles and members dynamically at runtime in ASP.Net??
|
|
|
|
|
I think you will require HTTP handlers to do so, as soon as the requests are process such things can be set there ...
Regards,
Jaiprakash M Bankolli
jaiprakash.bankolli@gmail.com
|
|
|
|
|
Hello
Am a beginner in asp.net please help with trhe code for this problem.After the user selected the Projectmanager from the dropdownlist displayed insidethe repeator,when the user clicks Submit to Manager button the form should be submited to all the manager selected in the dropdownlist of the repeator.Repeator is used in mt application to create a table/number of rows.
Please help me it's agent
Thanking you in advance
oga m
|
|
|
|
|
Little problem involving ASP.NET, C#, ImageButtons and events
I have a list of many items. These are displayed as imagebuttons, and their NavigateUrl property is set to 'page.aspx?productID=' + item.productID . This works just fine, but the problem is that this actually results in a redirect, when a simple postback is enough.
The list of items is still displayed, and when redirect happens, it has to be retrieved again from the DB, whereas with postback it can just stay the same, and the new information is added to it.
How can I fix this? Is there a way to add some data (like productID) to a button, give all the dynamic buttons the same event, so that when it is pressed, you can get the information from the object sender parameter in the event?
Thank you
Visual Studio can't evaluate this, can you?
public object moo<br />
{<br />
__get { return moo; }<br />
__set { moo = value; }<br />
}
|
|
|
|
|
If you are using ImageButton, you can use PostbackUrl Property of the ImageButton. It does same as the NavigateUrl , but with a IsPostback = True . Check it out... I have used it long time before.
|
|
|
|
|
hi frenz,
i am new to asp.net feild, plz say me how to connect compare validator with the database and to use server.transfer. wath is the code to close the window(like unload me in vb6.0)?
mvj_asp
-- modified at 2:57 Wednesday 4th April, 2007
|
|
|
|
|
u r ! on IM || SMS. Try writing clearly. Try Search box at the top of the page.
only two letters away from being an asset
|
|
|
|
|
i want to open new browser window by cliking on button
pop-up should be open whether pop-up blocker if on or off in browser
|
|
|
|
|
If the pop-up blocker is on you will not be able to open a new window. You have to use javascript to open a new window and the pop up blocker can't tell the difference. All you can do is ask your users to turn off pop up blocker for your site.
Ben
|
|
|
|
|
|
Hi all,
We would like to implement/integrate digital signature solution with third party document management solution(which has Rich API). We looked at commercial digital signature solutions and it looked like they are not affordable at all for Non-Profit org in India.I'm lead developer on this module.
Reuirement-
- Web signing: Sign documents(Doc,XLS,PDF,Tiff) online from ASP.NET DMS solution), they have viewer
- Offline verifiablity : When documents are sent via email to someone outside organisation, how they can verify that document is from outside source.
My Findings-
- We can use Crypto API / CAPICOM to get certificate and sign it and put signature embedded in Doc,Xls,PDF file.
- For offline verifiablity who does not have DMS solution, some thick app could be given who looks for signature in Doc,Xls,PDF file and tells signer, CA, Sign date.
Problems-
Embedded signature : Client need to have Office installed to sign document, even though he does not need to edit document.
Detached signature : Document can not be verified outside Organisation or DMS solution.
It looks like I'm missing something, please shad some light or just share your views on it.
Thanks,
Maulik.
"We are all angles with only one wing, only way we can fly is cooperation"
|
|
|
|
|
Hi here am using two tables so i used join query for relation...Now i want to use this join query in update sql command...Is it possible to use it in Update...if yes, please send me a sql query for that
With Regards,
Samson
|
|
|
|
|
update a
set a.value = "value" from
TableA a join TableB b on
a.id = b.id
where b.id = 1
|
|
|
|
|
I would suggest write a SP and put the updates in transaction and perform the task
Regards,
Jaiprakash M Bankolli
jaiprakash.bankolli@gmail.com
|
|
|
|
|
|
[ASP.NET1.1,C#]
how to provide Forms Authentication to a solution with more than one project.
How can i provide Forms Authentication common to entire solution when all projects have their own web.config files.
|
|
|
|
|
I want the store Values in XML file like as Database and Search/Modify/Delete the Data From that File.
and Display it in website as Tabular Format.
If you have the Code Please send Me soon
Thanks
Mohan Balal
|
|
|
|
|
What u have done so far?
What error you got, tell we are here to solve your Problem?
Dont post it simply please Send me Code Soon.
Regards,
Satips.
|
|
|
|
|
Hi All,
Please send me Interview Questions on ObjectOriented Programming
Thanks inAdvance.
|
|
|
|
|
Get it from our Best Friend Google.
Regards,
Satips.
|
|
|
|
|
hi,
once visit this site
www.geekinterview.com
u can find interview questions
|
|
|
|
|
Could anyone help me 'wat is digital certificate'. and send me details about how to use digital certificate in ASP.NET...?
Thanking YOU...
|
|
|
|
|