|
I found how to write an entire GridView to a new excel file but what I am wanting is to just write
like Textbox1.Text to row 7 cell 3.
How would I go about doing this?
|
|
|
|
|
you would use the Microsoft SDK for controlling office in .NET to do that.
Christian Graus
Please read this if you don't understand the answer I've given you
"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 )
|
|
|
|
|
i added a crystal report to one of my asp.net pages and it works fine in the sense that its loaded and displayed on the screen and paging and everything works.
But whenever i click on the export or print menu on the report it doesn't do either. i am not sure what i am doing wrong is that i am suppose to set something in the code behind? or some event needs to be set i am not sure.
so can anyone tell me how i can allow my crystal report to be exported or printed?
|
|
|
|
|
<CR:CrystalReportViewer ID="rptViewer" runat="server" AutoDataBind="true" DisplayGroupTree="False" EnableDrillDown="False" EnableToolTips="False" HasCrystalLogo="False" HasSearchButton="False" HasToggleGroupTreeButton="False" PrintMode="pdf" ReuseParameterValuesOnRefresh="True" />
That's my code for the report viewer
Are you binding to the report view programmatically?
I know I've seen this problem but I'm still trying to recall how we fixed it. Did you enable viewstate?
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="reports.aspx.cs" EnableEventValidation="false" EnableViewState="true" Inherits="reports" %>
-----------------------------------------------------------
"When I first saw it, I just thought that you really, really enjoyed programming in java." - Leslie Sanford
|
|
|
|
|
yes i am binding it programically is that the problem? i did all of the above and its still not working
|
|
|
|
|
i know when you got to print or export it queries for new data.
i thought that enableviewstate=true was the fix.
do you pass the report view logon credentials in the code? or do you type them into the form
[edit]
that's actually probably a dumb question. but if you dont pass the logon credentials and just bind the report file to the view then perhaps when you attempt to print or export it is just getting locked out.
[/edit]
-----------------------------------------------------------
"When I first saw it, I just thought that you really, really enjoyed programming in java." - Leslie Sanford
modified on Thursday, May 22, 2008 2:06 PM
|
|
|
|
|
Hi
I am new to ASP.net calendar control. I figured out most of the things except following:
1. How to display last 6 (or 9 or 12) months of calendar on a page. So that user can simply click on a date to open a new page with the data related to that date.
2. Want to disable all the date links before certain date because there is no information in system before that date. Of course, any future date links should be disabled too.
Please advise. Thanks
Pankaj
|
|
|
|
|
You cannot do it with the standared calender control .You will have to create a custom one yourself.
Thanks
Laddie
Kindly rate if the answer was helpful
|
|
|
|
|
|
You might need to change the format of your date
Plus you have spelt where wrong in your query
|
|
|
|
|
Why don't you test the query in query analyzer before implementing it ?
|
|
|
|
|
thank you,
i used query analyzer but the result that be shown was all of books.
select * from mytable where date>1/1/2008
Hoda
modified on Thursday, May 22, 2008 11:06 AM
|
|
|
|
|
CheckBoxList cbl = (CheckBoxList)sender;
if (cbl.Items[0].Selected && cbl.SelectedIndex.Equals(0))
{
for (int items = 1; items < cbl.Items.Count; items++)
{
if (!cbl.Items[items].Selected)
cbl.Items[items].Selected = true;
}
}
else if (!cbl.Items[0].Selected && cbl.SelectedIndex.Equals(1))
{
for (int items = 1; items < cbl.Items.Count; items++)
{
if (cbl.Items[items].Selected)
cbl.Items[items].Selected = false;
}
}
I use this above code to check all items in a CheckBoxList. But if all checkboxes are check and I uncheck some the SelectedValue = 0 of the CheckBoxList. In that case it wil check all checkboxes again. How to prevent this?
|
|
|
|
|
I understand your problem.
Since you don't get any information about which of the items was checked/unchecked this won't work.
The best way to do it, is to make one item that does the (un)checking. For example
<asp:CheckBox ID="checkall" runat="server" AutoPostBack="true" Text="(un)check all"
OnCheckedChanged="checkall_CheckedChanged" />
<asp:CheckBoxList ID="listCheck" runat="server" AutoPostBack="true" OnSelectedIndexChanged="listCheck_SelectedIndexChanged">
<asp:ListItem Text="Main1"></asp:ListItem>
<asp:ListItem Text="Main2"></asp:ListItem>
<asp:ListItem Text="Main3"></asp:ListItem>
<asp:ListItem Text="Main4"></asp:ListItem>
<asp:ListItem Text="Main5"></asp:ListItem>
</asp:CheckBoxList>
private bool overrideEvent;
protected void listCheck_SelectedIndexChanged(object sender, EventArgs e)
{
overrideEvent= true;
checkall.Checked = false;
}
protected void checkall_CheckedChanged(object sender, EventArgs e)
{
if (overrideEvent)
return;
for (int items = 0; items < listCheck.Items.Count; items++)
listCheck.Items[items].Selected = checkall.Checked;
}
Notice the use of the boolean, if I manually set the Checked of the checkall item, I don't want the checklist to change, so that's why i use the boolean.
|
|
|
|
|
i want to access other PC Screen like Teamviewer in asp.net
|
|
|
|
|
You cannot do that with ASP.NET. You need to write an app to do it, a java plug in can do it via the web, that's how gotomeeting works, for instance.
Christian Graus
Please read this if you don't understand the answer I've given you
"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 )
|
|
|
|
|
I Want to do paging in HTML tables.And i want to show 5 cell in a row.my code perfectly running with one cell in one row and i am unable to show 5 cell in a row.Can any body tell me where i am wrong?
|
|
|
|
|
Your code is broken. We need to see the code to tell you more
A GridView will create tables with any page size you like from a dataset.
Christian Graus
Please read this if you don't understand the answer I've given you
"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 everybody,
I've made a winapp that displays items in a storage. Each of these items is implemented as a control and is added as childcontrols to a parent, a StorageControl. With this design I can have click events for each item etc.
Now I want to convert this winapp into a webapp and have thought about implementing it in a similar way. I can make a "StorageControl", that is renderd as a DIV-tag with a specified width and height. I can also add items as childcontrols to this StorageControl. But how can I specify these items position in the DIV as X,Y-coordinates?
Is it possible at all?
Or is there any other smart solutions to my problem? A clickable imagemap?
Thanks...
|
|
|
|
|
Hello,
I have a gridview with checkboxes(inside Gridview) and a Button contol(outside of Gridview)with BtnDeleteSelected
My aim is to get the value of 1st row 2nd column in gridview(1st Column is CheckBox control) and 2nd column is pid value.I want 'Pid' Value
i wrote this code
int pID = Convert.ToInt32(gv.DataKeys[row.RowIndex].Value);
it is showing this error
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
Pinna
modified on Thursday, May 22, 2008 9:15 AM
|
|
|
|
|
haripinna wrote: GridViewRow row = gv.Rows[i];
CheckBox chkbox = (CheckBox)row.FindControl("chkSelect")
Oh what code have u posted. I can`t get head or tails out of it..Pls post the entire code so that we can understand your logic implementation.
|
|
|
|
|
Hello,
Thanks for your response.
I got answer for that question..
now my problem is
I have a gridview with checkboxes(inside Gridview) and a Button control(outside of Gridview)with BtnDeleteSelected
My aim is to get the value of 1st row 2nd column of gridview(1st Column is CheckBox control) and 2nd column is pid value.I want 'Pid' Value
i wrote this code
for(i=0;i<gv.rows.count;i++)>
{
GridViewRow row = gv.Rows[i];
CheckBox chkbox = (CheckBox)row.FindControl("chkSelect")
if(chkbox.checked)
{
int pID = Convert.ToInt32(gv.DataKeys[row.RowIndex].Value);
}
}</gv.rows.count;i++)>
it is showing this error
Index was out of range. Must be non-negative and less than the size of the collection.<br />
Parameter name: index
Pinna
|
|
|
|
|
Try this
string strContactId = "" + gvContacts.SelectedDataKey["ContactId"];
or
string strContactId = "" + gvContacts.SelectedValue;
You have to write these Code in OnSelectedIndexChanged event of gridview.Initially you have to set Datakeynames="ContactId" in gridview property.
i hope it wil work for u
|
|
|
|
|
|
at the moment you are only finding the checkbox
Wheres the code which should be setting the checkbox to true or false
Can you explain a bit more?
|
|
|
|