Click here to Skip to main content
15,891,993 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
using System;
using Gtk;
using System.Configuration;
using FogSoft.MonoReport.Processing ;
using System.Data.SqlClient;
using System.Data;
namespace rptt
{
	class MainClass
	{
		public static void Main (string[] args)
		{
			/*Application.Init ();
			MainWindow win = new MainWindow ();
			win.Show ();
						Application.Run ();	
						*/

			TemplateProcessor.Process ("C:\\b\\news.xls",
			                           "F\\news.xls",
			                           Getdata());
						}
		private static string GetTemplatePath(string templateFileName)
		{
			const string baseTemplatePath=@"C:\b\";
			return baseTemplatePath + templateFileName ;
		}
		private static string GetResultPath (string reportFileName)
		{
			const string baseReportsPath=@"C:\b\";
			return baseReportsPath + reportFileName ;
		}
		private static DataSet Getdata()
		{
		/*	SqlConnection con = new SqlConnection(@"data source=digiwebtech.com;initial catalog=digiwebtech_com_adagency;persist security info=True;user id=adagency;password=india123;");
			SqlCommand cmd=new SqlCommand ("select category from releaseorder",con);
			SqlDataAdapter da=new SqlDataAdapter ();
			da.SelectCommand =cmd;

			da.Fill (dt);*/
			DataSet dt=new DataSet ();
			DataTable da=new DataTable ();
			da.Columns.Add ("category");
			da.Rows.Add ("hellocate");
			dt.Tables .Add(da);

			return dt;
		}

	}
}


Here is my code there is exception occur FILENOTFOUND Exception when i run this code at line
VB
TemplateProcessor.Process ("C:\\b\\news.xls",
                                       "F\\news.xls",
                                       Getdata());
Posted
Comments
[no name] 8-Jun-14 10:40am    
Is "F\\news.xls" a valid filename and path on your system? I bet it's not.
[no name] 8-Jun-14 13:04pm    
No, C:\\b\\news.xls is valid filename with file exists but F:\\news.xls is not a valid filename and i think i should be generated by it or correct me
[no name] 8-Jun-14 13:20pm    
Error is at this line
TemplateProcessor.Process ("C:\\b\\news.xls","C:\\b\\b\\news.xls",Getdata());

System.Io.filenot found exception now i have given new url as i have given above but and both files exist at their place .......but same error
[no name] 8-Jun-14 15:03pm    
.xls is not a template file. http://www.monoreport.com/Documentation/html/d067d3af-04f6-e255-6d7a-5e8391f4c83f.htm

1 solution

Please see http://www.monoreport.com/Documentation/html/d067d3af-04f6-e255-6d7a-5e8391f4c83f.htm[^]

You need to pass a template into the first parameter. Also, make sure your code has permissions to the proper directories.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900