TeeChart.Net v3 in a Windows Service
TeeChart.Net v3 in a Windows Service
Hello Steema Team,
I want to use the Teechart.Net v3 in a Windows Service to export Charts in jpeg-files.
I tried to create a new Chart with "new Chart()" in the Service, but it doesn´t work. My Service stoped immediately
without any Exception.
Is it possible to do something like this, and if yes, can I find somewhere an Example or a tutorial?
Greets Centrii
I want to use the Teechart.Net v3 in a Windows Service to export Charts in jpeg-files.
I tried to create a new Chart with "new Chart()" in the Service, but it doesn´t work. My Service stoped immediately
without any Exception.
Is it possible to do something like this, and if yes, can I find somewhere an Example or a tutorial?
Greets Centrii
Re: TeeChart.Net v3 in a Windows Service
Hello Steema Team,
I´m still working on this Issue and I found a Post in this forum that it should work.
But it doesnt´t work for me.
I hope that you can give some advise to solve my problem.
Greets Centrii
I´m still working on this Issue and I found a Post in this forum that it should work.
But it doesnt´t work for me.
I hope that you can give some advise to solve my problem.
Greets Centrii
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: TeeChart.Net v3 in a Windows Service
Hi Centrii,
Have you tried creating a Steema.TeeChart.TChart instead of a Steema.TeeChart.Chart?
Thanks in advance.
Have you tried creating a Steema.TeeChart.TChart instead of a Steema.TeeChart.Chart?
Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: TeeChart.Net v3 in a Windows Service
Hello Narcís,
thank you for your answer.
I tried now creating with Steema.TeeChart.TChart, but still have the same Problem.
My Service stop immediately without any Exception after I call
Greets Centrii
thank you for your answer.
I tried now creating with Steema.TeeChart.TChart, but still have the same Problem.
My Service stop immediately without any Exception after I call
Code: Select all
Steema.TeeChart.TChart report = new Steema.TeeChart.TChart();
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: TeeChart.Net v3 in a Windows Service
Hi Centrii,
Could you please try assigning the Administrator account to the service to see if it makes a difference.
Thanks in advance.
Could you please try assigning the Administrator account to the service to see if it makes a difference.
Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: TeeChart.Net v3 in a Windows Service
Hi Narcís,
I already tried the Administrator Account, but this has no effect.
Greets Centrii
I already tried the Administrator Account, but this has no effect.
Greets Centrii
Re: TeeChart.Net v3 in a Windows Service
Hi Narcís,
I tried it also in a Windows Forms application and it works great with the same Function like in my Windows Service.
I´m using the same TeeChart.dll
I hope you can give me some usefull advise.
Greets Centrii
I tried it also in a Windows Forms application and it works great with the same Function like in my Windows Service.
Code: Select all
try
{
String Filename = @"C:\test_" + DateTime.Now.ToString("dd_hhmmss") + ".jpg";
Steema.TeeChart.TChart report = new TChart();
report.Chart.Height = 768;
report.Chart.Width = 1024;
Steema.TeeChart.Styles.Line line = new Steema.TeeChart.Styles.Line(report.Chart);
line.Active = true;
line.FillSampleValues(50);
line.Title = "Test";
report.Legend.Visible = true;
report.Export.Image.JPEG.Save(Filename);
}
catch (Exception ex)
{
}
I hope you can give me some usefull advise.
Greets Centrii
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: TeeChart.Net v3 in a Windows Service
Hello Centrii,
Thanks for the information.
In that case it may be a licensing issue. Can you please download the evaluation version and install it in another machine so that we can check if it's a licensing problem? Evaluation version has no license control but expires after 40 days of its installation. If evaluation version works and registered version doesn't we will try to provide a solution to the problem.
Thanks in advance.
Thanks for the information.
In that case it may be a licensing issue. Can you please download the evaluation version and install it in another machine so that we can check if it's a licensing problem? Evaluation version has no license control but expires after 40 days of its installation. If evaluation version works and registered version doesn't we will try to provide a solution to the problem.
Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: TeeChart.Net v3 in a Windows Service
Hello Narcís,
I dont have a second machine where I can install VS and the Eval version.
But I uninstalled the TeeChart v3 completely from my machine and installed the new v2009 evaluation version (4.0.2009.21357)
and I still get the same error.
Meanwhile I figured out that I probably get a System.IO.FileNotFoundException as soon I want to create a new TChart.
Rigth now I have no idea what I have to do next to solve the Problem.
I hope you can give me some more advice.
Thank you in advance
Greets Centrii
I dont have a second machine where I can install VS and the Eval version.
But I uninstalled the TeeChart v3 completely from my machine and installed the new v2009 evaluation version (4.0.2009.21357)
and I still get the same error.
Meanwhile I figured out that I probably get a System.IO.FileNotFoundException as soon I want to create a new TChart.
Rigth now I have no idea what I have to do next to solve the Problem.
I hope you can give me some more advice.
Thank you in advance
Greets Centrii
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: TeeChart.Net v3 in a Windows Service
Hi Centrii,
In that case it could be that your Windows Service can't find TeeChart.dll. You could check it using File.Exists, for example:
You could also try loading TeeChart.dll dynamically, for example:
Hope this helps!
In that case it could be that your Windows Service can't find TeeChart.dll. You could check it using File.Exists, for example:
Code: Select all
if (System.IO.File.Exists("TeeChart.dll"))
{
Steema.TeeChart.TChart tChart1 = new Steema.TeeChart.TChart();
}
Code: Select all
private CompilerParameters compilerParams;
private void InitializeCompilerParameters()
{
//add compiler parameters
compilerParams = new CompilerParameters();
compilerParams.CompilerOptions = "/target:library /optimize";
compilerParams.GenerateExecutable = false;
compilerParams.GenerateInMemory = true;
compilerParams.IncludeDebugInformation = false;
compilerParams.ReferencedAssemblies.Add("mscorlib.dll");
compilerParams.ReferencedAssemblies.Add("System.dll");
compilerParams.ReferencedAssemblies.Add("System.Drawing.dll");
compilerParams.ReferencedAssemblies.Add("System.Windows.Forms.dll");
compilerParams.ReferencedAssemblies.Add(Application.StartupPath + "\\TeeChart.dll");
}
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: TeeChart.Net v3 in a Windows Service
Hello Narcís,
Thank you very much.
Loading TeeChart.dll dynamically did help.
I cannot explain why my Service don´t find the dll, because it is in the same folder like the Service.
I will try to figure it out, but for now I´m happy with this solution.
Thanks again
Greets Centrii
Thank you very much.
Loading TeeChart.dll dynamically did help.
I cannot explain why my Service don´t find the dll, because it is in the same folder like the Service.
I will try to figure it out, but for now I´m happy with this solution.
Thanks again
Greets Centrii
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: TeeChart.Net v3 in a Windows Service
Hi Centrii,
You're very welcome! I'm glad to hear that helped.
You're very welcome! I'm glad to hear that helped.
You could check TeeChart's AssemblyFolders settings as described here or you may need to register TeeChart.dll in the GAC if it isn't. Here you'll find and example on how to register TeeChart.dll to the GAC.I cannot explain why my Service don´t find the dll, because it is in the same folder like the Service.
I will try to figure it out, but for now I´m happy with this solution.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |