|
tjkota wrote: To generate the web form as word document I have used C#
Even though you generate the Word file using the HTML tags, it is not the actual Word file. Rather I can call it HTML Word file.
tjkota wrote: The problem is that the word document generated does not look straight. Fields are not properly aligned and margins are messed up with the result that the print-out does not even print the entire document.
The problem may be your stylesheet. Are you using any stylesheet for the HTML/ASPX page to render properly?? If so when you save it as Word file, the Css references would miss. May be this is your problem. To solve this problem,
* Inject the styles you used in the page, in the same page itself using tags
or
* Change the Css reference to the full path (http://www.mydomain.com/css/mycss.css) rather using than partial relative path (css/mycss.css). This idea work well only when you able to connect to www.mydomain.com at all time.
|
|
|
|
|
hi Venkatesh, Thanks for your suggestions. I replaced the stylesheet references with inline style and that took care of fonts etc however the columns widths are still disturbed (i am not using stylesheets for this). Also text that is entered in textarea does not show on the html word doc, although text from input text boxes shows. Any advise on this? Thanks, Teja
|
|
|
|
|
tjkota wrote: I replaced the stylesheet references with inline style and that took care of fonts etc however the columns widths are still disturbed (i am not using stylesheets for this).
This can be acheived only by styles. Apply some style to fix the width of the column and try to export.
|
|
|
|
|
Good day.
How can I check in aspx whether or not the combobox is checked or not before the page gets posted back? I tried using a requiredFieldValidator, but apparently I cannot use that validation control with comboboxes?
|
|
|
|
|
You can write a custom validator in javascript.
By checked I assume you mean, a value has been selected. The best way IMO is for it to start with a default selection.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi there i'm using file upload control to upload files to the server
but i'm asking how to rename these file which the user specify to upload becuase there are some users write a very long file name
is there is any solution
thanks
|
|
|
|
|
After you upload, you can use PostedFile.SaveAs wherein you can give a filename of your choice.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
I have a crystal report which was running fine but now gives me an error about logon failed and it highlights the following line:
oStream = crpt28.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat)
Here is the code I am using:
Imports System.Web.Security
Imports System.Data.SqlClient
Imports System.DateTime
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
Dim crpt28 As CrystalReport28
Dim crpt28 As CrystalReport28
Dim myTable As CrystalDecisions.CrystalReports.Engine.Table
Dim myLogin As CrystalDecisions.Shared.TableLogOnInfo
Dim Param As SqlParameter
Dim SqlCom As SqlCommand
Dim sqlcon As New SqlConnection("Data Source=server;database=data;user id=user;password=pass")
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
crpt28 = New CrystalReport28
For Each myTable In crpt28.Database.Tables
myLogin = myTable.LogOnInfo
myLogin.ConnectionInfo.Password = "kris"
myLogin.ConnectionInfo.UserID = "kris"
myTable.ApplyLogOnInfo(myLogin)
Next
CrystalReportViewer1.ReportSource = crpt28
Dim oStream As New System.IO.MemoryStream
oStream = crpt28.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat)
Response.Clear()
Response.Buffer = True
Response.ContentType = "application/pdf"
Try
Response.BinaryWrite(oStream.ToArray())
Response.End()
Catch err As Exception
Response.Write("< BR >")
Response.Write(err.Message.ToString)
End Try
crpt28.Close()
crpt28.Dispose()
crpt28 = Nothing
End Sub
|
|
|
|
|
macca24 wrote: oStream = crpt28.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat)
Your db credentials that are being used are correct?
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
|
Hi all,
I am using asp.net2.0 , C# and sql server 2005.
When i fill the dropdownlist with two color based on contdtion in recordset it fill successfully but on seletedindex _change those color vanish but record remains.
how can i persist data with color ?
the code i used to fill the data is
foreach (DataRow row in dtcompany.Rows)
{
if (row["HM_TRG_FLAG"].Equals(true) )
{
ListItem item = new ListItem(row[1].ToString(), row[0].ToString());
// item.Attributes.Add("Tooltip", row[1].ToString());
item.Attributes.Add("style", "color:GREEN");
ctrl.Items.Add(item);
//ctrl.Items.Add(new ListItem(ctrl.Items.Add(item);, row[0].ToString()));
}
else
{
ListItem item = new ListItem(row[1].ToString(), row[0].ToString());
// item.Attributes.Add("style", "color:RED");
item.Attributes.Add("Tooltip", row[1].ToString());
ctrl.Items.Add(item);
}
}
regards
imran khan
|
|
|
|
|
Check the default setting of drop downlist remove if drop down list have default settings
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
i did not get what do you mean by default setting is it viewstate
please reply.
regards
imran khan
|
|
|
|
|
Hi,
I want to generate two levels of menu items using asp:menu control in asp.net 2.0. how can i do it?
basically, if i have lots of menu items, i want to continue with the menu items on second line or second level. i dont want to make a page scrollable. hope i am very much clear...
modified on Monday, February 18, 2008 1:46 AM
|
|
|
|
|
|
hi sanjubaba,
As we know asp:Menu control provide any level menu but it is not flexible to use directly becuase your menu will become static. If you want to change menu items than you have to change front-end. Hence it is better to use database driven menu using asp:Menu control.
Just check this link.
Building a Database Driven Hierarchical Menu using ASP.NET 2.0
Hope this will help you.
Thanks & Regards
Dilip Kumar Vishwakarma
If this post is answer for your query then don't forget to mark as an answer.
|
|
|
|
|
I created a form with some Controls and Validators
It works well on localhost
but after publishing, it works somtimes and sometimes it gives the error "Unable to validate data."
this is my page
http://www.mersaal.com/FeedBack.aspx[^]
Can anybody gess the source of this error
I say again that the error appears sometimes
Mohamed Gouda
Egypt
|
|
|
|
|
Are you using AJAX and javascript at same time ?
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
playing with bugs ) wrote: Are you using AJAX and javascript at same time ?
I used none of them
Mohamed Gouda
Egypt
|
|
|
|
|
Hi,
I think that problem might be occured at the time when user enter any special tag like chararcter in textboxes like '<' or '>'.
So first you check with this possibility and write RequestValidate = "false" in Page directive.
But this attribute affects security of your site.
Regards,
Amar
|
|
|
|
|
amargujrathi2006 wrote: So first you check with this possibility
First, thanks for the good hint , the tag like characters generates an exception that I need to handle
But the old problem still not solved
Mohamed Gouda
Egypt
|
|
|
|
|
Seems like problem in the ViewState. Have to tried searching in www.asp.net forums?? Click here[^]
|
|
|
|
|
We're using AJAX with an ASP.Net 2.0 site, and we've come across a problem.
We have a simple repeater control that contains a label, textbox, and checkbox. We've ajaxed out page and all is working well, except for this one little problem:
Our repeater controls are in their own update panel, and wheneven we check a checkbox in our repeater control, everything AFTER the updatepanel with our repeater controls in it, dissappears.
We've googled a ton and can't figure this one out. We would be thankful for any help.
Paul Brower
|
|
|
|
|
Does your repeater make me.Context.Response calls? Me.Context does not always return the same object.
|
|
|
|
|
Hi Poul,
Ya it will happen as it will get reset.
you will have store the changes in each post back whether it is asynchronous and synchronuos.
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|