|
So what is your problem when do caching based on that commandName...?I think, when a button is cliecked...you just check if the data is already cached or not...if not, load from DB and cache it...if already, just read from cache...is that ok?
<< >>
|
|
|
|
|
Actually I am using Output caching ..not data caching..
<%@ OutputCache Duration="120" VaryByParam=
I wanna cache different versions of the page depending on the commandname argument...
JO
|
|
|
|
|
Hello all,
I have been working on this project for quite some time now and to be honest i cant stand it anymore! I have a simple request, i want to get a parameter, taken from a querysting and pass it to a crystal report.
I have setup the crystal report viewer on my default.aspx page and by setting the default value of the parameter, i am able to view the crystal report. Here is the follwing code that i use
---------------------------------------------------------------------------------
<CR:CrystalReportViewer ID="rptViewer" Runat="server" AutoDataBind="True"
Height="947px" ReportSourceID="CrystalReportSource1" Width="845px" DisplayGroupTree="False" EnableDatabaseLogonPrompt="True" HasRefreshButton="True" />
<CR:CrystalReportSource ID="CrystalReportSource1" runat="server">
<Report FileName="SS_Server.rpt">
<Parameters>
<CR:Parameter ConvertEmptyStringToNull="False" DefaultValue="45"
Name="SERVER_ID" ReportName="" />
</Parameters>
</Report>
</CR:CrystalReportSource>
------------------------------------------------------------------------------------
This code works fine, however i want to have the parameter SERVER_ID to be taken from a querystring sent to this page! Si in my innocence i thought, instead of having the defaultvalue="45" can i use DefaultValue=" <% response.write request.querystring('server_id') %>" but this doesnt work.
I have read somewhere that like a control parameter one can code a querystring parameter! Does anyone know how to do this??
Im sure someone can help me, the idea behinf this is so simple, but im only new to Asp and am not sure where im goin wrong.
If anyone can help it would be greatly appreciated!
|
|
|
|
|
Do you get any runtime exception ??
Make sure the parameter type on the report and your program match...
Also try using DefaultValue=" <% request.querystring('server_id').tostring() %>"
Let me know...
JO
|
|
|
|
|
Jo, thanks for your reply and suggestions
1. no i dont get any runtime exception
2. yes the parameters match
3. i tried ur method but it acts the same as mine, it simply prompts for the parameter, server_id
i was reading on MSDN site that one can use a querystringparameter;
http://msdn2.microsoft.com/en-us/library/ms227827(VS.80).aspx[^]
However i cannot find any example that use this and cannot get the querystringparameter tag to work!
Could it be that the crystalreportsource control does not allow this segment of asp code??
Could it be somethin wrong with my web.config file or something im not including in the default.aspx.vb page????
Any help would be great,
Thanks again
|
|
|
|
|
Is this report being set off by a click of a button...
Just a thought...Try saving this query string variable in viewstate in your page_load method...
ViewState("x")=QueryString("serverid").tostring()
Then use ViewState as a parameter...
If you have prepared crystal document object use
crDcoument.Parameters.Add(x,y) method to associate the parameter value with the report..
x=name of the parameter in crystal report
y=value of the parameter..in ur case its ViewState("x").tostring()
Let me know
JO
|
|
|
|
|
JO
No, i click a hyperlink in a page which directs to default.aspx like this /default.aspx?Server_id=45 then in default.aspx i have a request.querystring('server_id') statement, this all works, and i can read the value 45, but i cant insert the request statement into the crystalreportsource control!
Im not great with VB, and so dont really understand what you mean by ur last post Jo, but am i wrong in my method, surely it should be so simple!
Could it be something got to do with the crystalreportsource control. like it doesnt accept asp code in the middle of it??
I am also reviewing this example, and i cant pass a parameter into that either!!!
http://www.codeproject.com/vb/net/CrystalReports_in_VBNET.asp[^]
Aaaaahhhh, please someone help
|
|
|
|
|
hi,
I have a login form. when i login with my user name it should be redirected to another form. in that form i have a table column(not in datagrid) with days monday to sunday in which i have 6 text boxes under each day namely intime, outtime, extratime,nonworktime,leavehrs and total. In that if i enter the values for each textboxes ie.., in hours(user enters it daily-day by day) , all the values should be submitted in the database for the corresponding days and should not be able to modify the values which are entered once. Can anybody pls send me source code for this in c# code behind or pls give me a solution for this.
Regards
Kavi
|
|
|
|
|
Hi Kavi:
The solution is that you should do this by dividing big task into small tasks...first you know how to design GUI? Know how to read data from DB?....And ask the specific questions here
<< >>
|
|
|
|
|
Divide the problem in three parts GUI,Business and database layer
crate one after another First try yourself any problem arrives then ask
|
|
|
|
|
hai,
i want to develope asp.net web project.any tools to design the project specs,Preparing DSD,screen shots.
Thanks and regards
surendra
|
|
|
|
|
Hi..
I am devoloping one site in which i want to code such way that one user can send mail to other user. Is it possibel???
I got 30 mail id from our isp provider can i use it??
How should i use this?? plese give in detail.
(Asp.net and c#)
Thanks in advance...
girish donde
|
|
|
|
|
Hi there:
Yes it's possible...using this namespace System.Web.Mail
<< >>
|
|
|
|
|
you can use MailMessage object in System.mail namespace...
JO
|
|
|
|
|
Hi all,
I have a problem with my datagrid. i have created three template columns in my datagrid but i cant access the column contents in code behind. I used
Allot_Grid.SelectedItem.Cells[1].Text to access the first col of the grid but it returns null.
Help!!!
|
|
|
|
|
Hi use
Allot_Grid.SelectedItem.FindControl("controlId")
you must be using some control inside your TemplateColumn. The above code will give you the reference to the control as an object. You have to typecast it to the control and then use can use the properties of the control.
Thanks,
Pradipta Basu
|
|
|
|
|
Dear all'
I have an ASP.Net page where i create dynamic asp table and inside it i create dropdpwnlist, i want to retrieve the values of the dropdownlist when i press the submit button
Could any one help me ????
|
|
|
|
|
Hi there:
You have to re-bind dropdownlist when posting back...
<< >>
|
|
|
|
|
Hi All,
Can someone give me help in sorting GridView.I need to sort the GirdView the up and down image.I have done this in C# in my pervious project but now I want to do it in VB. But its not working.Can any one convert this code in VB which should be working???
Please Help me...Thanks in advance.
public static void GetSort(System.Web.UI.WebControls.DataGrid dgGrid,System.Data.DataTable ds,string sortExpr)
{
//Sorts the DataGrid
DataView dv = new DataView(ds);
for(int i=0; i<dgGrid.Columns.Count; i++)
{
if (dgGrid.Columns[i].HeaderText.Trim().Length > 0 && dgGrid.Columns[i].Visible == true)
{
int index = dgGrid.Columns[i].HeaderText.IndexOf("<img");
if (dgGrid.Columns[i].SortExpression == sortExpr && dgGrid.Columns[i].SortExpression.Length > 0)
{
if (index >= 0) // Already sorted
{
int index1 = dgGrid.Columns[i].HeaderText.IndexOf("bar_down.gif");
if (index1 >= 0)
{
// sort Asc
dgGrid.Columns[i].HeaderText = dgGrid.Columns[i].HeaderText.Substring(0,index);
dgGrid.Columns[i].HeaderText += "<img src=../Images/bar_up.gif height=13 width=13 border=0>";
dv.Sort = sortExpr+ " ASC ";
}
else
{
// sort Desc
dgGrid.Columns[i].HeaderText = dgGrid.Columns[i].HeaderText.Substring(0,index);
dgGrid.Columns[i].HeaderText += "<img src=../Images/bar_down.gif height=13 width=13 border=0>";
dv.Sort = sortExpr+ " DESC";
}
}
else
{
dgGrid.Columns[i].HeaderText += "<img src=../Images/bar_up.gif height=13 width=13 border=0>";
dv.Sort = sortExpr + " ASC";
}
}
else
{
if (index >=0)
{
dgGrid.Columns[i].HeaderText = dgGrid.Columns[i].HeaderText.Substring(0,index);
}
}
}
}
dgGrid.DataSource = dv;
dgGrid.DataBind();
}
}
|
|
|
|
|
Public Shared Sub GetSort(ByVal dgGrid As System.Web.UI.WebControls.DataGrid, ByVal ds As System.Data.DataTable, ByVal sortExpr As String) <br />
Dim dv As DataView = New DataView(ds) <br />
Dim i As Integer = 0 <br />
While i < dgGrid.Columns.Count <br />
If dgGrid.Columns(i).HeaderText.Trim.Length > 0 AndAlso dgGrid.Columns(i).Visible = True Then <br />
Dim index As Integer = dgGrid.Columns(i).HeaderText.IndexOf("<img") <br />
If dgGrid.Columns(i).SortExpression = sortExpr AndAlso dgGrid.Columns(i).SortExpression.Length > 0 Then <br />
If index >= 0 Then <br />
Dim index1 As Integer = dgGrid.Columns(i).HeaderText.IndexOf("bar_down.gif") <br />
If index1 >= 0 Then <br />
dgGrid.Columns(i).HeaderText = dgGrid.Columns(i).HeaderText.Substring(0, index) <br />
dgGrid.Columns(i).HeaderText += "<img src=../Images/bar_up.gif height=13 width=13 border=0>" <br />
dv.Sort = sortExpr + " ASC " <br />
Else <br />
dgGrid.Columns(i).HeaderText = dgGrid.Columns(i).HeaderText.Substring(0, index) <br />
dgGrid.Columns(i).HeaderText += "<img src=../Images/bar_down.gif height=13 width=13 border=0>" <br />
dv.Sort = sortExpr + " DESC" <br />
End If <br />
Else <br />
dgGrid.Columns(i).HeaderText += "<img src=../Images/bar_up.gif height=13 width=13 border=0>" <br />
dv.Sort = sortExpr + " ASC" <br />
End If <br />
Else <br />
If index >= 0 Then <br />
dgGrid.Columns(i).HeaderText = dgGrid.Columns(i).HeaderText.Substring(0, index) <br />
End If <br />
End If <br />
End If <br />
System.Math.Min(System.Threading.Interlocked.Increment(i),i-1) <br />
End While <br />
dgGrid.DataSource = dv <br />
dgGrid.DataBind <br />
End Sub
|
|
|
|
|
Hi,
Its not working I am getting the header as UserCode<img src=../Images/bar_up.gif height=13 width=13 border=0>
but I want the image there with UserCode.
Please help.
Thanks in advance...
|
|
|
|
|
Hi varshav,
This might work for u.
Public Shared Sub GetSort(ByVal dgGrid As System.Web.UI.WebControls.DataGrid, ByVal ds As System.Data.DataTable, ByVal sortExpr As String)
'Sorts the DataGrid
Dim dv As DataView = New DataView(ds)
Dim i As Integer = 0
Do While (i < dgGrid.Columns.Count)
If ((dgGrid.Columns(i).HeaderText.Trim.Length > 0) _
AndAlso (dgGrid.Columns(i).Visible = true)) Then
Dim index As Integer = dgGrid.Columns(i).HeaderText.IndexOf("<img")
if="" ((dggrid.columns(i).sortexpression="sortExpr)" _
="" andalso="" (dggrid.columns(i).sortexpression.length=""> 0)) Then
If (index >= 0) Then
Dim index1 As Integer = dgGrid.Columns(i).HeaderText.IndexOf("bar_down.gif")
If (index1 >= 0) Then
' sort Asc
dgGrid.Columns(i).HeaderText = dgGrid.Columns(i).HeaderText.Substring(0, index)
dgGrid.Columns(i).HeaderText = (dgGrid.Columns(i).HeaderText + "")
dv.Sort = (sortExpr + " ASC ")
Else
' sort Desc
dgGrid.Columns(i).HeaderText = dgGrid.Columns(i).HeaderText.Substring(0, index)
dgGrid.Columns(i).HeaderText = (dgGrid.Columns(i).HeaderText + "")
dv.Sort = (sortExpr + " DESC")
End If
Else
dgGrid.Columns(i).HeaderText = (dgGrid.Columns(i).HeaderText + "")
dv.Sort = (sortExpr + " ASC")
End If
ElseIf (index >= 0) Then
dgGrid.Columns(i).HeaderText = dgGrid.Columns(i).HeaderText.Substring(0, index)
End If
End If
i = (i + 1)
Loop
dgGrid.DataSource = dv
dgGrid.DataBind
End Sub
|
|
|
|
|
Hi,
Its not working I am getting the header as UserCode<img src=../Images/bar_up.gif height=13 width=13 border=0>
but I want the image there with Header Text.
Please help.
Thanks in advance...
|
|
|
|
|
I'm busy creating a report with Web Developer Express and the Reporting Add-In. Can anyone help me to add a tab-space to a textbox on a report. I've looked for a solution for a couple of hours now and can't seem to find anything that works.
Thank you.
|
|
|
|
|
textbox1.text += textbox1.text +"\t";
|
|
|
|