フィルターのクリア

Error generating requirements report

2 ビュー (過去 30 日間)
Chris Paredis
Chris Paredis 2021 年 2 月 4 日
コメント済み: Chris Paredis 2021 年 2 月 5 日
I am generating a requirements report using the following code:
slreqFile = "someFile.slreqx";
rs = slreq.load(slreqFile);
slreq.generateReport(rs);
and get the following error:
Invalid link target "docs-internal-guid-2a040ff5-7fff-98db-b640-22e97bf2104a" as DOCX does not support more than 40 characters in the target name.
It looks like the name of the target is too long, but this name is internally generated and I cannot figure out how to control/change this name.

採用された回答

Leo
Leo 2021 年 2 月 4 日
Hi Chris,
Was your requirement content directly copied from some external source, e.g. Google Docs. I know the copy/paste aciton from some external source will generate this kind of attributes (e.g. something like <a name="docs-internal-guid-bcf2aa5b-7fff-37c7-b87b-57dbc5637775"></a> ). This results in the failure of docx report generation. So far, this limitation is from Microsoft Word and we cannot control it yet. If this is not the case, maybe we need more information to identifier where the issue is from.
As a workaround, you can generate an html report first, then convert it to word document using Microsoft Word:
reqOpt = slreq.getReportOptions;
reqOpt.reportPath = 'c:\myreport.html';
slreqFile = "someFile.slreqx";
rs = slreq.load(slreqFile);
slreq.generateReport(rs, reqOpt);
As another workaround, you can try to see whether the exernal resource supports exporting to the html file. After export to html file, you can directly open the html in the browser, then copy the content from the browser to the requirement editor.
Hope this helps.
Thanks,
ZQ
  3 件のコメント
Leo
Leo 2021 年 2 月 5 日
If you want to modify the requirement description, you can use the public API. like:
allReqs = slreq.find('Type', 'Requirement');
for index = 1:length(allReqs)
req = allReqs(index);
if contains(req.Description, 'docs-internal-guid')
% here the req.Description is the raw html content.
% do some modification to get the here, e.g
% req.Description = strrep(req.Description, 'invalid-attributed-pattern', '');
end
end
Hope this helps.
Thanks,
ZQ
Chris Paredis
Chris Paredis 2021 年 2 月 5 日
thanks for the suggestion. I was plan on using
req.Description = extractHTMLText(req.Description);

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB Report Generator についてさらに検索

製品


リリース

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by