我如何传递条形码图像以报告rdlc作为参数

时间:2018-08-20 07:23:26

标签: c#

Iam通过Code128BarcodeDraw类为orderid生成条形码,并且 生成这样的图像

rating

之后,我已通过

之类的功能将图像转换为base64。
item name

之后,我将数据传递给报表

Traceback (most recent call last):
  File "C:\Users\WCS\AppData\Local\Programs\Python\Python36-32\demo000000.py", line 71, in <module>
    w.writerow(reviews)
  File "C:\Users\WCS\AppData\Local\Programs\Python\Python36-32\lib\csv.py", line 155, in writerow
    return self.writer.writerow(self._dict_to_list(rowdict))
  File "C:\Users\WCS\AppData\Local\Programs\Python\Python36-32\lib\csv.py", line 151, in _dict_to_list
    + ", ".join([repr(x) for x in wrong_fields]))
ValueError: dict contains fields not in fieldnames: 'reviews'

在内部OrderPaymentPrint表单构造函数中,我设置了报表数据集和参数,如

import csv
import requests

url = "https://eatstreet.com/api/v2/restaurants/{}?yelp_site="

res = requests.get("https://eatstreet.com/api/v2/locales/madison-wi/restaurants")
with open('reviews.csv', 'w', newline='') as f:
    w = csv.DictWriter(f,['name','eta','messg','reviewer','rating'])
    w.writeheader()
    for item in res.json():
        itemid = item['id']
        req = requests.get(url.format(itemid))
        if not 'yelpReviews' in req.json():continue
        reviews = {}
        reviews['name'] = req.json()['name']
        reviews['eta'] = req.json()['waitTime']
        reviews['reviews'] = []
        for texualreviews in req.json()['yelpReviews']:
            reviews_data = {'messg':texualreviews['message'],'reviewer':texualreviews['reviewerName'],'rating':texualreviews['rating']}
            reviews['reviews'].append(reviews_data)
        w.writerow(reviews)

在内部报告中,我已拖动图像控件并将图像源设置为这样的参数 enter image description here

当我在打印报告上启动我的应用程序时,在图像上显示一个十字图标,如何解决此问题

enter image description here

0 个答案:

没有答案