473,395 Members | 1,738 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Very Very Urgent - Please help me


Hi,

I need to generate PDF stream when i click on Linkbutton in datagrid
..At present i hardcoded the
DMS Id and now it is working.But i need to pass DMS ID when click
linkbutton.How can i do that?

Here is the ASPX code:

<asp:datagrid id="grdTentativeResults" Width="800" Runat="server"
AutoGenerateColumns="False"
PageSize="50" PagerStyle-Position="TopAndBottom"
PagerStyle-HorizontalAlign="Left" PagerStyle-VerticalAlign="Middle"
HeaderStyle-Font-Bold="True" HeaderStyle-ForeColor="#000000"
HeaderStyle-CssClass="tableheader" AllowSorting="true"
AllowCustomPaging="false" Font-Name="verdana"
PagerStyle-Mode="NumericPages" OnPageIndexChanged="NewPage"
AllowPaging="True" Headerstyle-BackColor="#9B9BB4">
<AlternatingItemStyle BackColor="#e2e2e2" Font-Name="verdana"
/>
<Columns>
<asp:HyperLinkColumn DataNavigateUrlField="Case Number"
DataNavigateUrlFormatString="CaseInformationSummar y.aspx?CaseNo={0}"
DataTextField="Case Number" HeaderText="Case
Number"></asp:HyperLinkColumn>
<asp:BoundColumn DataField="Short Case Title"
HeaderText="Case Title" />
<asp:BoundColumn DataField="Event Type" HeaderText="Event
Type" />
<asp:BoundColumn DataField="Event Date" HeaderText="Event
Date" />
<asp:BoundColumn DataField="Event Time" HeaderText="Event
Time" />
<asp:BoundColumn DataField="Department"
HeaderText="Department" />
<asp:BoundColumn DataField="DMS Id"
Visible=False></asp:BoundColumn>
<asp:TemplateColumn HeaderText="Minute Order" >
<ItemTemplate>

<asp:LinkButton ID="linkView" runat="server"
CausesValidation="false" CommandName="View"
Text='<%# DataBinder.Eval(Container, "DMS Id")
%>'></asp:LinkButton>
</ItemTemplate>

</asp:TemplateColumn>
</Columns>
</asp:datagrid>
Code-Behind:

public void GetPDFDoc()
{
//Tentative tr=new Tentative();
Minute min=new Minute();

MemoryStream pdfStream = new MemoryStream();
SearchParams sp=new SearchParams();
sp.DmsID="2005";
pdfStream = min.GetMinuteOrderPdf(sp);
Response.Clear();
Response.Charset = "";
Response.ContentType = "application/pdf";
Response.AddHeader( "content-length", System.Convert.ToString(
pdfStream.Length ) );
Response.BinaryWrite( pdfStream.ToArray() );
Response.End();
}

private void grdTentativeResults_ItemCommand(object source,
System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
if(e.CommandName == "View")
{

GetPDFDoc();//need to pass DMSID
}
}

Nov 15 '06 #1
3 1529
First off, let me just say that "Very Very Urgent - Please help me" is a
pretty lousy choice of a subject line. Most people (Including me) find this
kind of approach a turn-off, and many people won't even respond to such a
post.

Bone up on your Netiquette and learn to provide a descriptive subject line.

Your eventhandler has the "e" parameter of type DataGridCommandEventArgs,
take a look at the properties it exposes. The "Item" property give you a
reference to the row in which the control was clicked.

Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"se****@gmail.com" wrote:
>
Hi,

I need to generate PDF stream when i click on Linkbutton in datagrid
..At present i hardcoded the
DMS Id and now it is working.But i need to pass DMS ID when click
linkbutton.How can i do that?

Here is the ASPX code:

<asp:datagrid id="grdTentativeResults" Width="800" Runat="server"
AutoGenerateColumns="False"
PageSize="50" PagerStyle-Position="TopAndBottom"
PagerStyle-HorizontalAlign="Left" PagerStyle-VerticalAlign="Middle"
HeaderStyle-Font-Bold="True" HeaderStyle-ForeColor="#000000"
HeaderStyle-CssClass="tableheader" AllowSorting="true"
AllowCustomPaging="false" Font-Name="verdana"
PagerStyle-Mode="NumericPages" OnPageIndexChanged="NewPage"
AllowPaging="True" Headerstyle-BackColor="#9B9BB4">
<AlternatingItemStyle BackColor="#e2e2e2" Font-Name="verdana"
/>
<Columns>
<asp:HyperLinkColumn DataNavigateUrlField="Case Number"
DataNavigateUrlFormatString="CaseInformationSummar y.aspx?CaseNo={0}"
DataTextField="Case Number" HeaderText="Case
Number"></asp:HyperLinkColumn>
<asp:BoundColumn DataField="Short Case Title"
HeaderText="Case Title" />
<asp:BoundColumn DataField="Event Type" HeaderText="Event
Type" />
<asp:BoundColumn DataField="Event Date" HeaderText="Event
Date" />
<asp:BoundColumn DataField="Event Time" HeaderText="Event
Time" />
<asp:BoundColumn DataField="Department"
HeaderText="Department" />
<asp:BoundColumn DataField="DMS Id"
Visible=False></asp:BoundColumn>
<asp:TemplateColumn HeaderText="Minute Order" >
<ItemTemplate>

<asp:LinkButton ID="linkView" runat="server"
CausesValidation="false" CommandName="View"
Text='<%# DataBinder.Eval(Container, "DMS Id")
%>'></asp:LinkButton>
</ItemTemplate>

</asp:TemplateColumn>
</Columns>
</asp:datagrid>
Code-Behind:

public void GetPDFDoc()
{
//Tentative tr=new Tentative();
Minute min=new Minute();

MemoryStream pdfStream = new MemoryStream();
SearchParams sp=new SearchParams();
sp.DmsID="2005";
pdfStream = min.GetMinuteOrderPdf(sp);
Response.Clear();
Response.Charset = "";
Response.ContentType = "application/pdf";
Response.AddHeader( "content-length", System.Convert.ToString(
pdfStream.Length ) );
Response.BinaryWrite( pdfStream.ToArray() );
Response.End();
}

private void grdTentativeResults_ItemCommand(object source,
System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
if(e.CommandName == "View")
{

GetPDFDoc();//need to pass DMSID
}
}

Nov 15 '06 #2
Hi,

I apologize for giving the weird subject line.Now the problem with
the datagrid display.

<asp:TemplateColumn HeaderText="Minute Order" >
<ItemTemplate>

<asp:LinkButton ID="linkView" runat="server" CausesValidation="false"
CommandName="View" Text='<%# DataBinder.Eval(Container, "DMS
Id") %>' ></asp:LinkButton>
</ItemTemplate>
</asp:TemplateColumn>

When i use the above code,it displays the DMS ID which i should
not,instead i should display View .How can i do that? Please suggest me
the solution.
It has to display as shown below:

Minute Order
View
View
View
View
View
Thanks,
Vishnu
First off, let me just say that "Very Very Urgent - Please help me" is a
pretty lousy choice of a subject line. Most people (Including me) find this
kind of approach a turn-off, and many people won't even respond to such a
post.

Bone up on your Netiquette and learn to provide a descriptive subject line.

Your eventhandler has the "e" parameter of type DataGridCommandEventArgs,
take a look at the properties it exposes. The "Item" property give you a
reference to the row in which the control was clicked.

Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"se****@gmail.com" wrote:

Hi,

I need to generate PDF stream when i click on Linkbutton in datagrid
..At present i hardcoded the
DMS Id and now it is working.But i need to pass DMS ID when click
linkbutton.How can i do that?

Here is the ASPX code:

<asp:datagrid id="grdTentativeResults" Width="800" Runat="server"
AutoGenerateColumns="False"
PageSize="50" PagerStyle-Position="TopAndBottom"
PagerStyle-HorizontalAlign="Left" PagerStyle-VerticalAlign="Middle"
HeaderStyle-Font-Bold="True" HeaderStyle-ForeColor="#000000"
HeaderStyle-CssClass="tableheader" AllowSorting="true"
AllowCustomPaging="false" Font-Name="verdana"
PagerStyle-Mode="NumericPages" OnPageIndexChanged="NewPage"
AllowPaging="True" Headerstyle-BackColor="#9B9BB4">
<AlternatingItemStyle BackColor="#e2e2e2" Font-Name="verdana"
/>
<Columns>
<asp:HyperLinkColumn DataNavigateUrlField="Case Number"
DataNavigateUrlFormatString="CaseInformationSummar y.aspx?CaseNo={0}"
DataTextField="Case Number" HeaderText="Case
Number"></asp:HyperLinkColumn>
<asp:BoundColumn DataField="Short Case Title"
HeaderText="Case Title" />
<asp:BoundColumn DataField="Event Type" HeaderText="Event
Type" />
<asp:BoundColumn DataField="Event Date" HeaderText="Event
Date" />
<asp:BoundColumn DataField="Event Time" HeaderText="Event
Time" />
<asp:BoundColumn DataField="Department"
HeaderText="Department" />
<asp:BoundColumn DataField="DMS Id"
Visible=False></asp:BoundColumn>
<asp:TemplateColumn HeaderText="Minute Order" >
<ItemTemplate>

<asp:LinkButton ID="linkView" runat="server"
CausesValidation="false" CommandName="View"
Text='<%# DataBinder.Eval(Container, "DMS Id")
%>'></asp:LinkButton>
</ItemTemplate>

</asp:TemplateColumn>
</Columns>
</asp:datagrid>
Code-Behind:

public void GetPDFDoc()
{
//Tentative tr=new Tentative();
Minute min=new Minute();

MemoryStream pdfStream = new MemoryStream();
SearchParams sp=new SearchParams();
sp.DmsID="2005";
pdfStream = min.GetMinuteOrderPdf(sp);
Response.Clear();
Response.Charset = "";
Response.ContentType = "application/pdf";
Response.AddHeader( "content-length", System.Convert.ToString(
pdfStream.Length ) );
Response.BinaryWrite( pdfStream.ToArray() );
Response.End();
}

private void grdTentativeResults_ItemCommand(object source,
System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
if(e.CommandName == "View")
{

GetPDFDoc();//need to pass DMSID
}
}
Nov 15 '06 #3
Hi there,

use this line: Text='View' CommandArgument='<%# DataBinder.Eval(Container,
"DMSId") %>'

Then, on the repeater_itemCommand event, check if e.item.commandName="View",
and if so, do your code here.
And to get the value of the DMS ID, it is stored in e.Item.CommandArgument.

regards,
Paul
<se****@gmail.comwrote in message
news:11**********************@k70g2000cwa.googlegr oups.com...
Hi,

I apologize for giving the weird subject line.Now the problem with
the datagrid display.

<asp:TemplateColumn HeaderText="Minute Order" >
<ItemTemplate>

<asp:LinkButton ID="linkView" runat="server" CausesValidation="false"
CommandName="View" Text='<%# DataBinder.Eval(Container, "DMS
Id") %>' ></asp:LinkButton>
</ItemTemplate>
</asp:TemplateColumn>

When i use the above code,it displays the DMS ID which i should
not,instead i should display View .How can i do that? Please suggest me
the solution.
It has to display as shown below:

Minute Order
View
View
View
View
View
Thanks,
Vishnu
>First off, let me just say that "Very Very Urgent - Please help me" is a
pretty lousy choice of a subject line. Most people (Including me) find
this
kind of approach a turn-off, and many people won't even respond to such a
post.

Bone up on your Netiquette and learn to provide a descriptive subject
line.

Your eventhandler has the "e" parameter of type DataGridCommandEventArgs,
take a look at the properties it exposes. The "Item" property give you a
reference to the row in which the control was clicked.

Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"se****@gmail.com" wrote:
>
Hi,

I need to generate PDF stream when i click on Linkbutton in datagrid
..At present i hardcoded the
DMS Id and now it is working.But i need to pass DMS ID when click
linkbutton.How can i do that?

Here is the ASPX code:

<asp:datagrid id="grdTentativeResults" Width="800" Runat="server"
AutoGenerateColumns="False"
PageSize="50" PagerStyle-Position="TopAndBottom"
PagerStyle-HorizontalAlign="Left" PagerStyle-VerticalAlign="Middle"
HeaderStyle-Font-Bold="True" HeaderStyle-ForeColor="#000000"
HeaderStyle-CssClass="tableheader" AllowSorting="true"
AllowCustomPaging="false" Font-Name="verdana"
PagerStyle-Mode="NumericPages" OnPageIndexChanged="NewPage"
AllowPaging="True" Headerstyle-BackColor="#9B9BB4">
<AlternatingItemStyle BackColor="#e2e2e2" Font-Name="verdana"
/>
<Columns>
<asp:HyperLinkColumn DataNavigateUrlField="Case Number"
DataNavigateUrlFormatString="CaseInformationSummar y.aspx?CaseNo={0}"
DataTextField="Case Number" HeaderText="Case
Number"></asp:HyperLinkColumn>
<asp:BoundColumn DataField="Short Case Title"
HeaderText="Case Title" />
<asp:BoundColumn DataField="Event Type" HeaderText="Event
Type" />
<asp:BoundColumn DataField="Event Date" HeaderText="Event
Date" />
<asp:BoundColumn DataField="Event Time" HeaderText="Event
Time" />
<asp:BoundColumn DataField="Department"
HeaderText="Department" />
<asp:BoundColumn DataField="DMS Id"
Visible=False></asp:BoundColumn>
<asp:TemplateColumn HeaderText="Minute Order" >
<ItemTemplate>

<asp:LinkButton ID="linkView" runat="server"
CausesValidation="false" CommandName="View"
Text='<%# DataBinder.Eval(Container, "DMS Id")
%>'></asp:LinkButton>
</ItemTemplate>

</asp:TemplateColumn>
</Columns>
</asp:datagrid>
Code-Behind:

public void GetPDFDoc()
{
//Tentative tr=new Tentative();
Minute min=new Minute();

MemoryStream pdfStream = new MemoryStream();
SearchParams sp=new SearchParams();
sp.DmsID="2005";
pdfStream = min.GetMinuteOrderPdf(sp);
Response.Clear();
Response.Charset = "";
Response.ContentType = "application/pdf";
Response.AddHeader( "content-length", System.Convert.ToString(
pdfStream.Length ) );
Response.BinaryWrite( pdfStream.ToArray() );
Response.End();
}

private void grdTentativeResults_ItemCommand(object source,
System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
if(e.CommandName == "View")
{

GetPDFDoc();//need to pass DMSID
}
}


Nov 15 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Joao Santa Barbara | last post by:
Hi all i have this error reading one registry key , can anyone assist me .. please very urgent i try in one computer, and work fine, but in other computer it didn´t work and throws this error...
2
by: Bill Yin | last post by:
Please tell me where can download <Beginning C# web Applications with Visual studio .net> 's code Thanks in advance!
4
by: pargat singh | last post by:
Hi I format my M/C and install fresh copy of Win2000 and ISS.First thing after that i install VS.net and every thing goes well without any error.When i try to open asp.net application i am...
0
by: Tulasi | last post by:
Hello, any one help me the problem due to Shopping cart. I am developping a project in that project,I want to connect shopping Carts in Vb.net.The shopping carts...
0
by: IT Recruiter | last post by:
*Very Urgent Rek - SQL Server DBA from Direct Client: Full time* @ New Jersey ***Please send your resumes IMMEDIATELY to nslakshmi@eprocorp.com*** Job Title: SQL Server Developer with...
33
by: dembla | last post by:
Hey Frnds can anyone help me in this i need a program in 'c' PROGRAM to print NxN Matrix 9 1 8 1 2 3 2 7 3 as 4 5 6 6 4 5 7 8 9 in sorted form
1
by: alok sengar | last post by:
hi, I have already tried this URL's code "http://www.java2s.com/Code/CSharp/Network/SimpleSNMP.htm" but I am getting error when i am creating a UDP type Socket and recieving packet from this...
0
by: Balamurugan Ranganathan | last post by:
I want to calculate the execution time of a sql query through C#.net this is to analysis two queries to compare their execution time it is very Urgent Please help me Please help Me ...
6
by: jenipriya | last post by:
Hi all... its very urgent.. please........i m a beginner in oracle.... Anyone please help me wit dese codes i hv tried... and correct the errors... The table structures i hav Employee (EmpID,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.