Doubt about Reportviewer C#

Asked

Viewed 458 times

0

Good evening, I wonder if you have how to put a text in the report for example I am making a receipt and put a textbox and I would like to put everything in the same line for example I received from(o), nameRazao_cli, CPF bearer, cpf_cli, the importance of(value in full).

nameRazao_cli and cpf_cli are coming from the database.

This would be the case in the report: I received from(o), Maria Aparecida, carrier of CPF, 111.111.111-11, the importance of (twenty reals).

Thanks

1 answer

1


You need to add an expression/formula. To concatenate the fields is simple. It would be something like this:

= "Recebi da(o), " & Fields!nomeRazao_cli.Value & ", portador do CPF," & Fields!cpf_cli.Value & ", a importância de " & Fields!vlExtenso.Value

Now the full value is something more complicated, I suggest you take a function, and run this function in the database:

select nomeRazao_cli, cpf_cli, fn_numeroExtenso(valor_recebido) as vlExtenso ...

The function code of the number in full is usually very large and I have nothing here at the moment, but I will leave links for you to base.

I could also do this function in C#, in case I don’t know how you’re taking the dice, if you’re playing a DataTable or IEnumerable<T> as source of report data, but regardless of that you could use this function, it would be something like this:

List<Recibo> recibos = repositorio.GetRecibos();
foreach(var recibo in recibos)
   recibo.vlExtenso = Funcoes.ValorPorExtenso(recibo.valor);
reportViewer.LocalReport.DataSources.Add(new ReportDataSource("dados", recibos));

Function links in full in SQL or C#

https://gist.github.com/ycaroafonso/7995399

https://social.msdn.microsoft.com/Forums/pt-BR/3ca5b29e-af07-4b04-a4a0-60c6a6afcec3/transformar-valor-r-575-em-por-extenso-cinco-reias-e-setenta-e-cinco-centavos?forum=transactsqlpt

https://gabrielrb.net/2013/12/23/conversao-de-numero-e-porcentagem-para-extenso-em-c/

Reference to Report Viewer formulas:

https://msdn.microsoft.com/en-us/library/ms252095(v=vs.80). aspx

  • Friend Murilo thank you very much helped me in matter of the figures in full I have a class that does it,

Browser other questions tagged

You are not signed in. Login or sign up in order to post.