|
i have given the following code to get pdf file from crystal report but at last line browser is not moving forwars its just showing process ...
can any one help in this regard
SqlConnection myConnection = new SqlConnection();
myConnection.ConnectionString = "Data Source=raj;User ID=sa;PWD=****;Initial Catalog=****";
SqlCommand MyCommand = new SqlCommand();
MyCommand.Connection = myConnection;
MyCommand.CommandText = "Select top 5 * from items";
MyCommand.CommandType = CommandType.Text;
SqlDataAdapter MyDA = new SqlDataAdapter();
MyDA.SelectCommand = MyCommand;
DataSet myDS = new DataSet();
MyDA.Fill(myDS, "items");
testrpt oRpt = new testrpt();
oRpt.SetDataSource(myDS);
ReportDocument doc = new ReportDocument();
string fileName = Server.MapPath("testrpt.rpt");
TableLogOnInfo LogInfo = new TableLogOnInfo();
LogInfo.ConnectionInfo.ServerName = "raj";
LogInfo.ConnectionInfo.UserID = "sa";
LogInfo.ConnectionInfo.Password = "sa!2009";
LogInfo.ConnectionInfo.DatabaseName = "fssads";
CrystalDecisions.CrystalReports.Engine.ReportDocument O_Report = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
O_Report.Load(Server.MapPath("testrpt.rpt"));
O_Report.Database.Tables[0].ApplyLogOnInfo(LogInfo);
O_Report.ExportToHttpResponse(ExportFormatType.PortableDocFormat, Response, true, "rptpdf");
|
|
|
|
|
Hi...
I have done code as bello,but i can't get result of YourMethod().
Kindly help to solve this issue.
Thanks.
FALDU PUJA
<asp:scriptmanager id="ScriptManager1" enablepagemethods="true" enablepartialrendering="true" runat="server">
function buttonClick()
{
alert(PageMethods.YourMethod("John Doe"));
}
<script>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true" EnablePartialRendering="true">
<input type="submit" value="Get Message" onclick="buttonClick();return false;" >
<form>
<script runat="server">
[System.Web.Services.WebMethod]
public static string YourMethod(string name)
{
return "Hello " + name;
}
|
|
|
|
|
pujafaldu wrote:
<b>[System.Web.Services.WebMethod]</b>
public static string YourMethod(string name)
{
return "Hello " + name;
}
wat you are trying to do here? y you have specified the attribute WebMethod? r u trying to create a webservice or what?
|
|
|
|
|
no,i m not cretaing webservice,but i just want to to call a server-side method from client-side.
|
|
|
|
|
first of all , i wud say that u should follow codebehind model. where server side method has to be written in .cs file.
then another thing is why u are creating a html control when you have to call a server side method
<input type="submit" value="Get Message" önclick="buttonClick();return false;" >
just place a server side control (Button/LinkButton/ImageButton) over there and call the method in the onclick event handler of that control.
|
|
|
|
|
Nisha Agrawal wrote: why u are creating a html control when you have to call a server side method
It's called AJAX, a technology you should do some research on.
only two letters away from being an asset
|
|
|
|
|
thanx mark, infact before this i have used only ajax toolkit and xmlhttprequest as ajax technology. seriously i need to explore it.
|
|
|
|
|
I would suggest you read a little documentation, the System.Web.Services.WebMethod attribute is used to create an AJAX callable method in the page class.
only two letters away from being an asset
|
|
|
|
|
AFAIK you need to include the method in a code-behind file, not inline like this
only two letters away from being an asset
|
|
|
|
|
|
A useless answer. Give the OP some credit (until proven wrong) he could do a Google search as well.
You didn't even know what a PageMethod was an hour ago, why would anyone take advise from you on this subject. The OP knew more than you. The best response from you would have been none at all.
only two letters away from being an asset
|
|
|
|
|
Mark Nischalke wrote: You didn't even know what a PageMethod was an hour ago, why would anyone take advise from you on this subject. The OP knew more than you.
Yes, i wasn't aware with this 1 hour before. but in this 1 hour a fast learner can learnt upto any level.
and if anyone don't wanna follow anyone's suggestions than its one's own decision. noone can do anything in this.
Mark Nischalke wrote: Give the OP some credit (until proven wrong) he could do a Google search as well.
have u opened that link once? i have included the link with it coz it telling us how to call the page method and the way was quite different than he is calling.
|
|
|
|
|
Nisha Agrawal wrote: in this 1 hour a fast learner can learnt upto any level.
Since this is a public site let me phrase it this why, you're full of excrement!!
only two letters away from being an asset
|
|
|
|
|
Mark Nischalke wrote: Since this is a public site let me phrase it this why, you're full of excrement!!
I wanted to say same thing. It's a public n technical forum where u are using so abusive language now.
|
|
|
|
|
hi sir
please help me.
sir i have a crystal report for my web application.the problem is that it varify login and password of database before show the report.but i want report should not ask for login password.the application is in asp.net.
|
|
|
|
|
Then delete the code that does it, duh!
What a useless question...
var question = (_2b || !(_2b));
|
|
|
|
|
Tht Not His Question?
Its Will ask hte username and password of Database .
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
I stand corrected.
Your reply was even more useless.
var question = (_2b || !(_2b));
|
|
|
|
|
Check The Crystal Report Render Username and Password
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
Hi All
My requirement is like codeProject...
when I search my forum caption in google...it gets listed in the top.
My requirement is we have a news section, when the user search the caption tile in the google ..related news should display in the google..
Please help me with this..
Thanks in Advance
Ramkumar
|
|
|
|
|
|
Hi All,
I'm working on a online survey. What I have accomplished is reading the table A (contain Question) and table B (contain Answer). I used Response.write() to format it to look like
Section 1
-------------
Question 1 | Answer 1 | Answer 2 | Answer 3 | Answer 4 | Answer 5
Response.Write("<input id='" & "rad" & radIDCount & "' name='" & subDataReader("QUESTION_ID") & "' type='radio' value='" & subDataReader("ANSWER_ID") & "' runat='server'/>")
How do I loop thru all the radio button and submit the answer to the oracle database? I tried the FindControl but i get no luck. Someone guide me to the right direction?
thanks
|
|
|
|
|
STI06 wrote: How do I loop thru all the radio button and submit the answer to the oracle database?
Given that you don't create any sort of server controls at all, your only chance is if you look at the form variables and can find the one for your radio button by name in there.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Hi,
can u explain briefly? which datacontrol used to bind the value?
|
|
|
|
|
thanks for reply. I have add the placeholder at Page_load and now I'm able to the find control. How do I check the value of the radio button in the FindControl?
Dim radValue As New RadioButton<br />
<br />
radValue = phControl.FindControl("rad1")<br />
<br />
If radValue.Checked = True Then<br />
Response.Write("I'm selected")<br />
End If
Now I want to find the value of the radio button. any help?
|
|
|
|