2
Answers

Crystal report in VS 13

scropio gurl

scropio gurl

8y
254
1

I have web static webmethod i.e

  1. [WebMethod]  
  2.     public static string search_data(DateTime fromdate, DateTime todate, string region)  
  3.     {  
  4.         try  
  5.         {  
  6.             string result = "";  
  7.             Ts1 td = new T1();  
  8.             DateTime frDate = new DateTime(fromdate.Year, fromdate.Month, fromdate.Day, 0, 0, 0);  
  9.             DateTime to_Date = new DateTime(todate.Year, todate.Month, todate.Day, 23, 59, 59);  
  10.             List<griddataresult_Result> dq = td.griddataresult(frDate, to_Date, region).ToList();  
  11.   
  12.                 DataTable dt = new DataTable();  
  13.                 dt.Columns.Add("ID"typeof(int));  
  14.                 dt.Columns.Add("OwnerName"typeof(string));  
  15.                 dt.Columns.Add("RegNo"typeof(string));  
  16.                 foreach (var c in dq)  
  17.                 {  
  18.   
  19.                     dt.Rows.Add(c.ID, c.OwnerName, c.RegNo);  
  20.                 }                  
  21.                 result = DataSetToJSON(dt);                
  22.             return result;  
  23.         }  
  24.         catch (Exception)  
  25.         {  
  26.             throw new Exception();  
  27.         }  
 

i call this static web method in jquery and i populate table with the help of jquery like this

  1.     var final = JSON.parse(result.d).response;  
  2.     console.log(JSON.parse(result.d).response);  
  3.     $("#tabledata").empty();  
  4.   
  5.     if (final.length > 0) {  
  6.         $("#tabledata").append(  
  7. "<thead><tr><th>ID</th><th>Owner</th><th>RegNo</th></tr></thead>");  
  8.   
  9.         for (var i = 0; i < final.length; i++) {  
  10.   
  11.             if (final[i] !== null) {  
  12.                 $("#tabledata").append("<tbody><tr><td>" +  
  13.                             final[i][0] + "</td> <td>" +  
  14.                             final[i][1] + "</td> <td>" +  
  15.                              final[i][2] + "</td> </tr></tbody>");  
  16.   
  17.             }  
  18.         }  
  19.         $("#tabledata tr:first").addClass('GridviewScrollHeader');  
  20.         $("#tabledata tr").addClass('GridviewScrollItem');  
  21.         $("#tabledata").addClass('GridviewScrollPager');  
  22.     }  
  23.     else {  
  24.        $("#tabledata").hide();  
  25.   
  26.         $("#<%=Label5.ClientID%>").text("No data");  
  27.     }  
  28.   
  29. },  
 

Data is successfully display in table . In web form page there is one drop-down and two date-picker (from date & to date) according to selection of these values table data is display is tablenow i want to create crystal report i want when i click on export button then table data ,drop down value & date-picker value will be display in report

how i display region, from date, to date value and table data in crystal report how i do this

Answers (2)