public JasperClient GetClient()
        {
            JasperConfig config = new JasperConfig("localhost");
            JasperAuthorization auth = new JasperAuthorization("jasperadmin", "jasperadmin");
            JasperClient report = new JasperClient(config, auth);

            return report;
        }
Beispiel #2
0
        public ActionResult GetReport()
        {
            JasperConfig config = new JasperConfig("localhost");
            JasperAuthorization auth = new JasperAuthorization("jasperadmin", "jasperadmin");
            JasperClient report = new JasperClient(config, auth);

            var response = report.Get("/reports/teste/ExemploTeste", new { UsuarioLogado = "Tadeu Rodrigues Arias" }, JasperReportFormat.PDF);

            return File(response.GetDocument(), response.GetContentType(), response.DefineFileName("Exemplo"));
        }
Beispiel #3
0
 /// <summary>
 /// Obter as configurações necessarias para estabelecer conexão.
 /// </summary>
 /// <param name="Config">configuração do servidor</param>
 /// <param name="Auth">informações de autenticação</param>
 public JasperClient(JasperConfig Config, JasperAuthorization Auth)
 {
     // TODO: Complete member initialization
     this.Config = Config;
     this.Auth = Auth;
 }
Beispiel #4
0
        static void Main(string[] args)
        {
            Console.Clear();
            Console.WriteLine("JasperManager command line");
            Console.WriteLine("---------------------------------------------------");

            JasperAuthorization auth = new JasperAuthorization("jasperadmin", "jasperadmin");
            JasperConfig config = new JasperConfig("localhost");
            client = new JasperClient(config, auth);

            string command = args[0].ToLower();
            string origem = args[1];
            string destination = string.Empty;
            string dataSourcePath = string.Empty;

            if (args.Length >= 3)
                destination = args[2];

            if (args.Length >= 4)
                dataSourcePath = args[3];

            switch (command)
            {
                case "upload":
                    {
                        Upload(origem, destination);
                    } break;
                case "deploy":
                    {
                        Deploy(origem, destination, dataSourcePath);
                    } break;
                case "clear":
                    {
                        Clear(origem);
                    } break;
                default:
                    break;
            }

            Console.WriteLine("---------------------------------------------------");
            Console.WriteLine("Finish");
        }