Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Erro neste ponto
- table = new DataTable();
- table = dst.Clone();
- table.Clear();
- set = new DataSet();
- public static void ImprimeCartas()
- {
- try
- {
- List<Itens> list = new List<Itens>();
- Uteis.Status("Inicio Consulta", servico);
- DataTable dst = new DataTable();
- string id = "0";
- ConsultaImpressao(dst, id, "0");
- dst.TableName = "DADOS";
- Uteis.Status(string.Concat(new object[] { "Consulta : ", dst.Rows.Count, " - ", DateTime.Now.ToString() }), servico);
- if (dst.Rows.Count > 0)
- {
- string str2 = AppDomain.CurrentDomain.BaseDirectory + "//Relatorios/Notificacao/" + dst.Rows[0]["modelo"].ToString();
- Uteis.Status("Arquivo usado" + str2, servico);
- if (!string.IsNullOrEmpty(str2))
- {
- int num = 0;
- int itens = 1;
- Uteis.Status("Gerando PDF " + dst.Rows.Count + " Registros", servico);
- DataTable table = dst.Clone();
- table.Clear();
- table.TableName = "DADOS";
- DataSet set = new DataSet();
- string str3 = Uteis.TempName();
- int num3 = 0x31;
- Uteis.Status((dst.Rows.Count / num3) + " Arquivos", servico);
- for (int i = 0; i < dst.Rows.Count; i++)
- {
- num++;
- table.ImportRow(dst.Rows[i]);
- if (num > num3)
- {
- try
- {
- set.Tables.Add(table);
- DocumentContainer container = DocumentContainer.Load(str2);
- container.MergeWithRegions(set);
- container.SalvarPdf(string.Concat(new object[] { AppDomain.CurrentDomain.BaseDirectory, "//Temp//", str3, "_", itens, ".pdf" }));
- ApagaPaginasemBranco(string.Concat(new object[] { AppDomain.CurrentDomain.BaseDirectory, "//Temp//", str3, "_", itens, ".pdf" }));
- Uteis.Status(string.Concat(new object[] { "Gerando arquivo ", str3, "_", itens, ".pdf" }), servico);
- object[] objArray5 = new object[] { AppDomain.CurrentDomain.BaseDirectory, "//Temp//", str3, "_", itens, ".pdf" };
- list.Add(new Itens(string.Concat(objArray5)));
- num = 0;
- itens++;
- //Erro neste ponto
- table = new DataTable();
- table = dst.Clone();
- table.Clear();
- set = new DataSet();
- }
- catch (Exception ex)
- {
- Uteis.GravaLogTxt("ImprimeCartas erro : ", ex.Message);
- }
- }
- }
- }
- }
- else
- {
- Uteis.Status("sem registros", servico);
- }
- }
- catch (Exception exception)
- {
- Uteis.Status(exception.Message, servico);
- }
- servico = 0;
- Uteis.GravaLogTxt("ImprimeCartas", "final");
- }
Add Comment
Please, Sign In to add comment