Exemplo n.º 1
0
        public JasperClient GetClient()
        {
            JasperConfig config = new JasperConfig("localhost");
            JasperAuthorization auth = new JasperAuthorization("jasperadmin", "jasperadmin");
            JasperClient report = new JasperClient(config, auth);

            return report;
        }
Exemplo n.º 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"));
        }
Exemplo n.º 3
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");
        }