Problema ao gerar imagem QrCode com API Google

Olá pessoal,

Estou tentando gerar no relatório fastreport .net um QrCode usando a api Google. A imagem é gerada mas não está trazendo o link completo. Vou postar aqui a forma como estou salvando no banco de dados e como estou chamando no relatório. I use version 1.2.47 of fastreport .net and I use Visual Studio 2015..

VB Code:

Private Sub PercorreGrid()

    Dim Gi As DataGridItem

    Dim pHfID As WebControls.HiddenField

    Dim pLink As WebControls.HyperLink

    Dim pUrl As String

    For Each Gi In Datagrid1.Items

      pHfID = Gi.Cells(3).FindControl("hfIDItem")

      pLink = Gi.Cells(3).FindControl("gLinkprivado")

'pLink should return:

      pUrl = Server.UrlEncode(pLink.Text)

'As I am using the Server.UrlEncode function, the link is returning:

      EditalItens.ExecutaSQLGenerica("UPDATE EDITALITENS SET " &

                      " LINKQRCODEITEM = '" & pUrl & "' WHERE ID = " & pHfID.Value)


  End Sub

Code in fastreport .net:

In the report, also using VB, the code looks like this:

Imports System

Imports System.Collections

Imports System.Collections.Generic

Imports System.ComponentModel

Imports System.Windows.Forms

Imports System.Drawing

Imports Microsoft.VisualBasic

Imports FastReport

Imports FastReport.Data

Imports FastReport.Dialog

Imports FastReport.Table

Imports FastReport.Barcode

Imports FastReport.Utils

Namespace FastReport

 Public Class ReportScript

  Private Sub Child2_BeforePrint(ByVal sender As object, ByVal e As EventArgs)

   If CType(Report.GetColumnValue("sdsDados.QRCODECOMPLETO"), String) <> "" Then

      imgQrCode.ImageLocation = "" & CType(Report.GetColumnValue("sdsDados.QRCODECOMPLETO"), String)

It turns out that the QrCode is created but the link is incomplete. When reading the QRCode, the candidate is taken to this link: leaving the whole part of the parameter &id=3D1T43E45ED8802BA23186898962C124F7E3

   imgQrCode.Visible = True  


    If CType(Report.GetColumnValue("sdsDados.QRCODECOMPLETO"), String) = "" Then

     imgQrCode.Visible = False

    End if

   End if


  End Sub

 End Class

End Namespace

How can I solve this problem?




Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.