|
Hi,
I am exporting my data in the word file in asp.net. The data is too long that it doesn't fit in one page of document file. it is almost few pages. Is there any way i can show my data pagewise so that the each section should be in one page. Right now since i do not know how to set that property, some sections are in the same page while some sections are in two pages.
Is there any way , any ideas ??
suchita
|
|
|
|
|
what are you talking about. Can you clarify your question.
|
|
|
|
|
Sure. I have some data like items list based on category. E.g.
Furniture category has items like table, chair ...
Stationary category has items like books,copies ...
I am showing list of items based on category. So each category is showing with items. So i am calling each category with items as one sections.
now i am showing these sections in the word file. since there are so many sections, they do not fit in one page of the word file. Now I want a complete section in one a page. But what is happening is --> since multiple sections are showing in one page, in case a complete section doesn't fit in one page, it is showing the rest in another page which is obvious. But I want complete section in one page so that its easier to view by the user.
Is there any way that in case a complete section doesn't seem to fit in the current page, it should show to the new page?
Is there any possibility to do that ?
suchita
|
|
|
|
|
I'm not sure how you are exporting your data to Word, but I think what you want to do is write a "Page Break" after each section, this will cause the next section to begin on a new page.
The way to do this in a Word macro is "Selection.InsertBreak Type:=wdPageBreak", however, I'm not sure how you are exporting the data to Word.
I believe "Page Break" is what you are looking for.
|
|
|
|
|
thanks for the reply. Ya i need the page break but can i do the page break from the ascx page ?
suchita
|
|
|
|
|
I'm still a bit confused.
Here is what I thought you were doing:
1) Create the dataset in your code behind
2) Export the data to a MS-Word document.
3) View that MS-Word document in your browser.
What I don't know is how your are performing the "Export". It is during this "Export" process that you would instruct MS-Word to insert a page break in the document.
Can you explain what you mean by "I am exporting my data in the word file in asp.net." in your original post.
I may be thinking of something different that what you are actually doing.
|
|
|
|
|
i am exporting into the MS_word document as you thought. I kept first in the dataset and from dataset to the word document and viewing that in browser.
suchita
|
|
|
|
|
Here is a code snipet of how to insert Page Breaks in your MS-Word document as you build it from your dataset ...
Dim oWordApp As New Word.Application
Dim oWordDoc As Word.Document
Dim oPara1 As Word.Paragraph
oWordApp.Visible = True
oWordDoc = oWordApp.Documents.Add()
oWordDoc.Activate()
oPara1 = oWordDoc.Content.Paragraphs.Add
oPara1.Range.Text = "Grouping 1"
oPara1.Range.InsertParagraphAfter()
oPara1 = oWordDoc.Content.Paragraphs.Add
oPara1.Range.Text = Chr(12) + "Grouping 2" ' Notice the chr(12) is appended before the title of the second group
oPara1.Range.InsertParagraphAfter()
'oWordDoc.SaveAs("C:\Page Break Test.doc")
oWordDoc.PrintPreview()
MsgBox("Close the word document now.")
oWordDoc.Close()
oWordApp.Quit()
oWordDoc = Nothing
oWordApp = Nothing
Try inserting the Chr(12) into your code whenever your grouping changes and you should see the page breaks appear.
Good luck.
|
|
|
|
|
I couldn't understand this code. Can you explain more please?
suchita
|
|
|
|
|
Hi,
i have sql query of getting the total value like this:
select ID,sum(Amount) from items group by ID
the query is giving value in sql server management.
Now I want that total sum value in the ascx page but I dont know what will be the paramter name for such column.
<%# DataBinder.Eval(Container.DataItem,"sum(Amount)") %>
sum(Amount) doesn't work. Does anyone know what will be the parameter name for such query ??
Thanks,
suchita
|
|
|
|
|
Well, let's give the column a new name;
select ID,sum(Amount) AS [TotalAmount] from items group by ID
<%# DataBinder.Eval(Container.DataItem,"TotalAmount") %>
I are Troll
|
|
|
|
|
|
I have a ajax tool calendarExtendarFromDate,imgFromDate,textBoxFromDate,calendarExtendarToDate,imgToDate and textBoxToDate,When a date is selected from calendarExtendarFromDate,that date is displayed in textBoxFromDate.Likewise in the case of calendarExtendarToDate.Here is the source code:
--------------------------------------------------------------
<asp:updatepanel id="UpdatePanel1" runat="server">
<contenttemplate>
<asp:textbox id="txtFromDate" runat="server" readonly="True">
<cc1:calendarextender id="CalendarExtenderFromDate" runat="server" cssclass="cal" targetcontrolid="txtFromDate" popupbuttonid="imgFromDate">
<cc1:calendarextender id="CalendarExtenderToDate" runat="server" onclientdateselectionchanged="CheckForFutureDate" cssclass="cal" targetcontrolid="txtToDate" popupbuttonid="imgToDate">
<cc1:calendarextender>
-------------------------------------------------------------
I have radiobuttons..When the radiobutton between is clicked,then only calendarExtendarToDate is enabled.otherwise it becomes in disabled state..I wrote code in jscript as below:
function validate()
{
document.getElementById("imgToDate").disabled=false;
document.getElementById("txtToDate").disabled=false;
}
//call this function in .aspx.cs as below:
rbBetween.Attributes.Add("onClick", "return validate()");
textbox is disabled.When between radio is clicked,then only enabled.But calendarextendar disabled didnt work.Pls help me...
|
|
|
|
|
Can you edit this please, I (and I doubt anyone) can read the code. You need to put the code between <pre></pre> tags, AND improve the whitespacing like this:
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<asp:TextBox ID="txtFromDate" runat="server" ReadOnly="True"> />
<cc1:CalendarExtender ID="CalendarExtenderFromDate" runat="server" CssClass="cal" TargetControlID="txtFromDate" PopupButtonID="imgFromDate"/>
</asp:UpdatePanel>
ragnaroknrol The Internet is For Porn[^]
Pete o'Hanlon: If it wasn't insulting tools, I'd say you were dumber than a bag of spanners.
|
|
|
|
|
Format this mess properly!
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
I knew there was a more succinct way of expressing what I just said
ragnaroknrol The Internet is For Porn[^]
Pete o'Hanlon: If it wasn't insulting tools, I'd say you were dumber than a bag of spanners.
|
|
|
|
|
|
You can add titlebar=yes, so it will add titlebar to the window.
HelpBtn.Attributes.Add("onclick", "window.open('" + helpPath + "','','height=600,width=800,status=yes,left=125,top=20,toolbar=no,menubar=no,scrollbars=yes,location=center,resizable=yes,titlebar=yes'); return false");
Tej Aj,
http://opexsolution.com/forum/[^]
Fan of:
http://www.abtstudioz.com/[^]
|
|
|
|
|
hi mates,
i'm a newbiew here in asp.net forum, i would like to ask.
how to put a place holder for login status in a masterpage?
i have already implemented the placeholder for pages. if my question is not clear, please see the snapshot.
[click here]
much better if you can give me a link or samples or templates
which is the same scenario on my snapshot.
i need to impress my boss.
thank you so much.
C# コードMicrosoft End User
2000-2008
「「「「「「「「「「「「「「「「「「「「「「「「「「「「
The best things in life are free
」」」」」」」」」」」」」」」」」」」」」」」」」」」」
|
|
|
|
|
C#Coudou wrote: i need to impress my boss.
normally you are not wrong. if you want to impress you boss, refer some site what your boos like and copy their style of login section.
|
|
|
|
|
thank you for reply.
but i dont have the sites which is the same as my scenario. i've already search in google.
C# コードMicrosoft End User
2000-2008
「「「「「「「「「「「「「「「「「「「「「「「「「「「「
The best things in life are free
」」」」」」」」」」」」」」」」」」」」」」」」」」」」
|
|
|
|
|
C#Coudou wrote: i dont have the sites which is the same as my scenario
Me too don't know what kind of site are looking in google. if you mention your scenario others can provide some sample links.
|
|
|
|
|
I creted rdlc in web application(vs 2008).Plase help me to encrypt and decrypt querystring..I have no idea about that.Pls help
|
|
|
|
|
|