|
Hi Guys
I am busy working on a serializer module ,and i have a quick question, lets for instance say i have a LINQ object called User, in a website I want to serialise it to a file , its marked non serializable so it will throw an exception.
Now i take that exact same object I store it in a session called "user" now if i want to call it back I simply go (User)Session[user]; and i have it back . now how does Sessions store that object so i can retrieve it back again ?
Is there maybe a way i can store this object as a byte array and recall it ?
Any help would be great
TThanx
Chona1171
Web Developer (C#), Silverlight
|
|
|
|
|
hi all,
i had been n trouble for weeks, to generate Pdf from Gridview. i tried to use iTextsharp, but not found any how to generate Pdf from HTML. Please help me. its urgent.
Thanks in Advance.
|
|
|
|
|
If you don’t want to use any 3rd party tool for the conversion then try using SSRS report (.rdl file) locally, you can host the report locally (mode=local) in your website and report viewer control will render the pdf file for you.
Regards,
Prakash Kalakoti
|
|
|
|
|
hi,
i used Microsoft report first, but the hosting server is not supporting the same. please help me friend.
|
|
|
|
|
For RDL report you don’t need it to be hosted somewhere it can run on Local Mode also. RDL file is just a template and can be used locally; you can add an rdl file in you website and set it as a report source for the reportviewer control.
Eg
ReportViewer1.LocalReport.ReportPath = Server.MapPath(@"~\Reports\MyReport.rdl");
DataSet dsReport = …
ReportDataSource rds = new ReportDataSource();
rds.Name = "MyDataSet";
rds.Value = dsReport.Tables[0];
ReportViewer1.LocalReport.DataSources.Add(rds);
Check this out
Using the ASP.NET 2.0 ReportViewer in Local Mode[^]
Regards,
Prakash Kalakoti
|
|
|
|
|
hi,
i tried the same first. But unfortunately the hosting server is not supporting Microsoft reporting & its dll's.
|
|
|
|
|
Have you tried coping all the reportviewer dll files in the deoloyment server.
Long back I faced same issue, because in my local system all required reportviewer dll was registered in GAC and same was not the case with the production server, so I copied all the dll files manually in the prod server which resolved the issue.
What error you are getting?
Regards,
Prakash Kalakoti
|
|
|
|
|
hi,
ya ya ,, u r correct. but, i tried the same also. but, for running the reportviewer dll, we have to give FULL Trust to that, which is not given by the server.
|
|
|
|
|
Hi,
i faced this issue last month , i think the best way to do convreting html to pdf is to use
a component for it try to google it
|
|
|
|
|
can u please suggest me a component and a sample code.
|
|
|
|
|
http://www.asppdf.com/[^]
I used this product
http://www.html-to-pdf.net/ExpertPDF-HtmlToPdf-Converter.aspx[^]
''' <summary>
''' Convert the HTML code from the specified URL to a PDF document and send the
''' document as an attachment to the browser
''' </summary>
''' <remarks></remarks>
Private Sub ConvertURLToPDF(ByVal url As String)
Dim urlToConvert As String = url
Dim selectablePDF As Boolean = True
' Create the PDF converter. Optionally you can specify the virtual browser
' width as parameter. 1024 pixels is default, 0 means autodetect
Dim pdfConverter As PdfConverter = New PdfConverter()
' set the license key
'pdfConverter.LicenseKey = "put your license key here"
' set the converter options
pdfConverter.PdfDocumentOptions.PdfPageSize = PdfPageSize.A4
pdfConverter.PdfDocumentOptions.PdfCompressionLevel = PdfCompressionLevel.Normal
pdfConverter.PdfDocumentOptions.PdfPageOrientation = PDFPageOrientation.Portrait
' set if header and footer are shown in the PDF - optional - default is false
pdfConverter.PdfDocumentOptions.ShowHeader = False
pdfConverter.PdfDocumentOptions.ShowFooter = False
' set to generate a pdf with selectable text or a pdf with embedded image - optional - default is true
pdfConverter.PdfDocumentOptions.GenerateSelectablePdf = True
' set if the HTML content is resized if necessary to fit the PDF page width - optional - default is true
pdfConverter.PdfDocumentOptions.FitWidth = True
' set the embedded fonts option - optional - default is false
pdfConverter.PdfDocumentOptions.EmbedFonts = False
' set the live HTTP links option - optional - default is true
pdfConverter.PdfDocumentOptions.LiveUrlsEnabled = True
' set if the JavaScript is enabled during conversion to a PDF with selectable text
' - optional - default is false
pdfConverter.ScriptsEnabled = False
' set if the ActiveX controls (like Flash player) are enabled during conversion
' to a PDF with selectable text - optional - default is false
pdfConverter.ActiveXEnabled = False
' set if the images in PDF are compressed with JPEG to reduce the PDF document size - optional - default is true
pdfConverter.PdfDocumentOptions.JpegCompressionEnabled = True
' enable auto-generated bookmarks for a specified list of tags (e.g. H1 and H2)
'If (cbBookmarks.Checked) Then
' pdfConverter.PdfBookmarkOptions.TagNames = New String() {"H1", "H2"}
'End If
' set PDF security options - optional
'pdfConverter.PdfSecurityOptions.CanPrint = True
'pdfConverter.PdfSecurityOptions.CanEditContent = True
'pdfConverter.PdfSecurityOptions.UserPassword = ""
' set PDF document description - optional
pdfConverter.PdfDocumentInfo.AuthorName = "Winnovative HTML to PDF Converter"
' add HTML header
'If (cbAddHeader.Checked) Then
' AddHeader(pdfConverter)
'End If
'' add HTML footer
'If (cbAddFooter.Checked) Then
' AddFooter(pdfConverter)
'End If
' Performs the conversion and get the pdf document bytes that you can further
' save to a file or send as a browser response
Dim pdfBytes As Byte() = pdfConverter.GetPdfBytesFromUrl(urlToConvert)
' send the PDF document as a response to the browser for download
Dim Response As System.Web.HttpResponse = System.Web.HttpContext.Current.Response
Response.Clear()
Response.AddHeader("Content-Type", "binary/octet-stream")
Response.AddHeader("Content-Disposition", "attachment; filename=ConversionResult.pdf; size=" & pdfBytes.Length.ToString())
Response.Flush()
Response.BinaryWrite(pdfBytes)
Response.Flush()
Response.End()
End Sub
|
|
|
|
|
if u dont mind, can u please give the Dll too. When i use, which i downloaded from google, shows a Red watermark in the pdf file.
modified on Wednesday, March 24, 2010 5:13 AM
|
|
|
|
|
|
There is lots dll, for purhcase. but we r looking for opensource only.
|
|
|
|
|
Hi guys,
A user is going to login and I will assign a sessionid and update the database,
I want to allow only one user to login at a time using the
same user details so I will check against the database value,
also when the user exits the browser, I want to destroy the
session and update the database , does anyone know how I can implement this?
please help
Thanks.
|
|
|
|
|
|
Hi all,
can anybody tell me which software is good to test page load. the software will have a button in the IE which you can start recod when a page is loading.
this will give you all the http data (get and post) and all object used in the page and how many each cost the page to load.
i am describing a tool that i used once last year. which i am not able to remember the name. only thing i can remember is "Professional" at the end of the name.
Hussain Mohammed Saleh Attiya
ISP Technical Manager
Atyaf Telcom - Bahrain
|
|
|
|
|
Try Fiddler[^]
Regards,
Prakash Kalakoti
|
|
|
|
|
thanks
i know fiddler.. but what i am looking for is much enhanced one. which i used .. but i realy cant remember full name
it also have an IE developer tool
Hussain Mohammed Saleh Attiya
ISP Technical Manager
Atyaf Telcom - Bahrain
|
|
|
|
|
Use AntProfiler will help you to get this type of data.
|
|
|
|
|
Hi Guys,
wen i am clicking a link, i am storing the cookie value and redirecting to another page using script...,
Eg:
----
<a onclick="javascript:test();">click</a>
<script language="javascript">
function test()
{
document.cookie="coktext=Hi~test";
window.location="testerpage.aspx";
}
</script>
In that redirection TesterPage.aspx, I have a Iframe page (Page Name = Iframe_tester.aspx)...,
In tht "TesterPage.aspx"...,Backend code i am getting the cookie value and passing the value to my iframe page using querystring...,
Code:
------
TesterPage.aspx.cs
if (Request.Cookies["coktext"] != null)
{
typepid = Request.Cookies["coktext"].Value;
arrtypepid = typepid.Split('~');
if (arrtypepid[0].ToString().ToLower().Trim() == "hi")
{
partid = arrtypepid[1].ToString();
}
else
{
partid = string.Empty;
}
}
else
{
partid = string.Empty;
}
page front end:
---------------
TesterPage.aspx
<iframe id="iframeid" src="/Iframe_tester.aspx?partid=<%=partid %>"
scrolling="no" frameborder="0" width="680px"></iframe>
Now my question is:
--------------------
The iframe page not getting the partid value...,
As per my code, i feel its correct...,
Is there any mistake i have done?
Is there any other way i can handle?
Thanks & Regards,
Member 3879881,
please don't forget to vote on the post
-- Modified Tuesday, March 23, 2010 5:03 AM
|
|
|
|
|
Member 3879881 wrote: function test()
{
document.cookie="coktext=Hi~test"; window.location="testerpage.aspx";
}
Try specifying the expiry date other wise the cookie will be cleared immediately.
Regards,
Prakash Kalakoti
|
|
|
|
|
Hi Prakash,
thanks for ur reply,
Plz check my script i also given the same format only...,
and understand my question, i didnt ask u to set cookie,
asking u ppls to get it on backend code...,
Thanks & Regards,
Member 3879881,
please don't forget to vote on the post
|
|
|
|
|
document.cookie="coktext=Hi~test";
You are setting the value to cookie as Hi~test
and at server side
typepid = Request.Cookies["coktext"].Value;
arrtypepid = typepid.Split('~');
if (arrtypepid[0].ToString().ToLower().Trim() == "markets")
you are expectiong the first part of the value to be "markets", but actually its "Hi".
Can you check you logic again?
Regards,
Prakash Kalakoti
|
|
|
|
|
sorry actually i mistyped as markets...,
Its
if (arrtypepid[0].ToString().ToLower().Trim() == "hi")
only,then also i didnt get o/p
Thanks & Regards,
Member 3879881,
please don't forget to vote on the post
|
|
|
|